コード例 #1
0
 static Vector2 FindWoundedTarget(GameData.Board map)
 {
     return(map.AllCoords
            .Where(p => map[p].IsWounded)
            .SelectMany(p => map[p].LinesNearby)
            .First(p => !map[p].IsKnown));
 }
コード例 #2
0
 static Vector2 FindMaxSliceSpaceTarget(GameData.Board map)
 {
     return(map.AllCoords
            .Where(p => !map[p].IsKnown)
            .OrderByDescending(p => map.GetLinesDistances(p).Sum())
            .First());
 }
コード例 #3
0
 private static void CheckShipOrientationPossibility(GameData data, GameData.Board map, Vector2 coords)
 {
     if (map.GetHorizontalDistances(coords).Sum() + 1 < data.MinShipSize)
     {
         map.MarkAsChecked(map[coords].HorizontalNearby);
     }
     if (map.GetVerticalDistances(coords).Sum() + 1 < data.MinShipSize)
     {
         map.MarkAsChecked(map[coords].VerticalNearby);
     }
 }