private Coordinates DamagedShipShot() { Random rand = new Random(Guid.NewGuid().GetHashCode()); var hitNeighbors = EnemyBoard.GetHitNeighbors(); var neighborID = rand.Next(hitNeighbors.Count); return(hitNeighbors[neighborID]); }
public Coordinates FireShot() { var hitNeighbors = EnemyBoard.GetHitNeighbors(); Coordinates coords; if (hitNeighbors.Any()) { coords = DamagedShipShot(); } else { coords = RandomShot(); } return(coords); }