Beispiel #1
0
 public Grid(int xSize, int ySize, StateSymbol firstState, List <string> axisLabels)
 {
     XSize      = xSize;
     YSize      = ySize;
     AxisLabels = axisLabels;
     InitializeCells(firstState);
 }
Beispiel #2
0
        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();
        }
Beispiel #3
0
 public void SetCell(Cell cell, StateSymbol state)
 {
     cell.State = state;
 }
Beispiel #4
0
 public void SetCell(Pos pos, StateSymbol state)
 {
     CellsNext[pos.X, pos.Y].State = state;
 }
Beispiel #5
0
 public void SetCell(int x, int y, StateSymbol state)
 {
     CellsNext[x, y].State = state;
 }
Beispiel #6
0
 public Cell(StateSymbol state, Pos pos)
 {
     State = state;
     Pos   = pos;
 }