Beispiel #1
0
        public void UpdateZonesAfterDefeatingShip(int[] coordinates)
        {
            Ship ship = PlayerShips.GetShipAtCoordinates(coordinates);

            if (!ship.IsAlive)
            {
                foreach (int[] zoneCoordinates in ship.SafeZoneCoordinates)
                {
                    Board.board[zoneCoordinates[0]][zoneCoordinates[1]].IsHit = true;
                    if (!(alreadySelected.Any(x => x[0] == zoneCoordinates[0] && x[1] == zoneCoordinates[1])))
                    {
                        alreadySelected.Add(zoneCoordinates);
                    }
                }
            }
        }