public Grid(int xSize, int ySize, StateSymbol firstState, List <string> axisLabels) { XSize = xSize; YSize = ySize; AxisLabels = axisLabels; InitializeCells(firstState); }
private void InitializeCells(StateSymbol firstState) { Cells = new Cell[XSize, YSize]; CellsNext = new Cell[XSize, YSize]; // Initialize next for (int r = 0; r < XSize; r++) { for (int c = 0; c < YSize; c++) { CellsNext[r, c] = new Cell(firstState.Copy(), new Pos(r, c)); } } // Push the initialized cells Push(); }
public void SetCell(Cell cell, StateSymbol state) { cell.State = state; }
public void SetCell(Pos pos, StateSymbol state) { CellsNext[pos.X, pos.Y].State = state; }
public void SetCell(int x, int y, StateSymbol state) { CellsNext[x, y].State = state; }
public Cell(StateSymbol state, Pos pos) { State = state; Pos = pos; }