Пример #1
0
        private bool[][] CreateGridToHostCells(IWorldCells worldCells)
        {
            if (worldCells is null)
            {
                throw new ArgumentNullException(nameof(worldCells), "Please Provide Cells for World Creation. ");
            }
            var cells = ((WorldCells)worldCells).Cells;
            var grid  = new bool[cells.Length][];

            for (int x = 0; x < cells.Length; ++x)
            {
                grid[x] = new bool[cells[x].Length];
            }
            return(grid);
        }
Пример #2
0
 public WorldGrid Clone(IWorldCells worldCells)
 {
     return(new WorldGrid(worldCells));
 }
Пример #3
0
 public WorldGrid(IWorldCells cells)
 {
     WorldCells = cells;
     Grid       = CreateGridToHostCells(cells);
 }