<commit_before>﻿namespace BaconGameJam6.Models.Player
{
    using System;
    using System.Linq;

    using BaconGameJam6.Models.Blocks;
    using BaconGameJam6.Models.Boards;

    public class Missile : BoardPiece
    {
        private readonly Ship ship;

        private const float Velocity = 1f;

        public Missile(Board board, Ship ship, int col, int row)
            : base(board, col, row)
        {
            this.X = ship.X;
            this.ship = ship;
        }

        protected override void OnUpdate(TimeSpan elapsedTimeSpan)
        {
            this.Y -= Missile.Velocity;
            this.Row = (int)this.Y;
            var block = (Block)this.Board.FirstOrDefault(
                piece => piece is Block && piece.Column == this.Column && piece.Row == this.Row && piece.IsActive);

            if (block != null)
            {
                this.Destroy();
                this.ship.RecordHit(block);
                block.Destroy();
            }
        }
    }
}<commit_msg>Destroying missiles that go off screen<commit_after>﻿namespace BaconGameJam6.Models.Player
{
    using System;
    using System.Linq;

    using BaconGameJam6.Models.Blocks;
    using BaconGameJam6.Models.Boards;

    public class Missile : BoardPiece
    {
        private readonly Ship ship;

        private const float Velocity = 1f;

        public Missile(Board board, Ship ship, int col, int row)
            : base(board, col, row)
        {
            this.X = ship.X;
            this.ship = ship;
        }

        protected override void OnUpdate(TimeSpan elapsedTimeSpan)
        {
            if (this.Y < 1)
            {
                this.Destroy();
                return;
            }

            this.Y -= Missile.Velocity;
            this.Row = (int)this.Y;
            var block = (Block)this.Board.FirstOrDefault(
                piece => piece is Block && piece.Column == this.Column && piece.Row == this.Row && piece.IsActive);

            if (block != null)
            {
                this.Destroy();
                this.ship.RecordHit(block);
                block.Destroy();
            }
        }
    }
}
{'fraction_non_alphanumeric': 0.0988857938718663, 'fraction_numerical': 0.004178272980501393, 'mean_word_length': 1.514585764294049, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5697776', 'n_tokens_mistral': 621, 'n_tokens_neox': 580, 'n_words': 142}