public ShotControl() { InitializeComponent(); DataContext = new Shot(new Point(), Direction.Down); }
private void FireShot(IShip ship, Direction direction) { if (ship is Player && _playerShots.Count < MaximumPlayerShots || ship is Invader) { var shot = new Shot(ship.Location, direction); if (ship is Player) { _playerShots.Add(shot); } else { _invaderShots.Add(shot); } OnShotMovedEventHandler(new ShotMovedEventArgs(shot, false)); } }