Beispiel #1
0
        public CellType[,] GetCurrentGameGridState()
        {
            Cell[,] gridCopy = grid.GetGridCopy();
            int gridSideLength = grid.GetGridSideLength();

            CellType[,] gridRepresentation = new CellType[gridSideLength, gridSideLength];

            foreach (Cell cell in gridCopy)
            {
                int row = cell.Coordinate.Row;
                int col = cell.Coordinate.Column;
                gridRepresentation[row, col] = cell.CellType;
            }

            return(gridRepresentation);
        }