예제 #1
0
 public MaptileInfo(Landtile landtile,
                    Unit unit,
                    bool reachableForSelectedUnit,
                    bool availableForSelectedUnitMove,
                    bool selectedUnitRoute)
 {
     Unit = unit;
     Land = landtile;
     ReachableForSelectedUnit     = reachableForSelectedUnit;
     AvailableForSelectedUnitMove = availableForSelectedUnitMove;
     SelectedUnitRoute            = selectedUnitRoute;
 }
예제 #2
0
        private static void PrintLandtileTitle(MaptileInfo tileInfo)
        {
            Landtile landtile = tileInfo.Land;

            Console.Write("[");
            WriteColored(landtile.ConsoleImage);
            Console.Write("] ");

            string name = tileInfo.Land.DisplayedName;

            Console.WriteLine(name + $"({map.SelectedTileX}; {map.SelectedTileY})");
        }
예제 #3
0
        private static Landtile[,] ParseMap(string chars, ICollection <Landtile> landtiles, int x, int y)
        {
            var outMap = new Landtile[x, y];
            int i      = 0;

            for (int r = 0; r < y; r++)
            {
                for (int c = 0; c < x; c++)
                {
                    outMap[c, r] = landtiles.First((Landtile _landtile) => _landtile.ConsoleImage.Char == chars[i]);
                    i++;
                }
            }
            return(outMap);
        }
예제 #4
0
        private static void PrintLandtileAndUnitTitle(MaptileInfo tileInfo)
        {
            Landtile landtile = tileInfo.Land;

            Console.Write("[");
            WriteColored(landtile.ConsoleImage);
            Console.Write("]");
            Unit unit = tileInfo.Unit;

            Console.Write("[");
            WriteColored(tileInfo.Unit.ConsoleImage);
            Console.Write("]");
            string landtileName = tileInfo.Land.DisplayedName;
            string unitName     = tileInfo.Unit.DisplayedName;

            Console.WriteLine(" " + landtileName + "/" + unitName + $"({map.SelectedTileX}; {map.SelectedTileY})");
        }