private static void EraseCell(Coords gridCoords, CellState cellState) { if (GridCoordsAreWithinBounds(gridCoords)) { DrawCharacter(gridCoords, ' '); } }
private static void DrawCell(Coords gridCoords, CellState cellState) { if (GridCoordsAreWithinBounds(gridCoords)) { var savedForegroundColor = Console.ForegroundColor; Console.ForegroundColor = cellState.IsZombie ? ConsoleColor.Magenta : ConsoleColor.Cyan; DrawCharacter(gridCoords, 'X'); Console.ForegroundColor = savedForegroundColor; } }
public Cell(CellState state) { State = state; }
public void ChangeCellState(CellState newCellState, int column, int row) { cellGrid.Cells[column, row].State = newCellState; }
public Cell(Position position, CellState cellState) { this._position = position; this._cellState = cellState; }
public ReadOnlyCell(CellState cellCellState) { _cellCellState = cellCellState; }
/// <summary> /// Copy constructor, used in history /// </summary> /// <param name="other">Cell object to copy from</param> public Cell(Cell other) { State = other.State; _gridPos = other._gridPos; StateTime = other.StateTime; }
/// <summary> /// Initializes the cell at the specified gird pos with the specified state /// </summary> /// <param name="state">The current state of the cell</param> /// <param name="gridPos">The grid position of the cell</param> public Cell(CellState state, Point gridPos) { State = state; _gridPos = gridPos; }
/// <summary> /// Actually updates the cell state /// </summary> public void EndUpdate() { State = _nextState; _nextState = CellState.Unknown; }
public Cell(string id, List<string> neighborsIds, CellState state = Alive) { this.Id = id; NeighborsIds = neighborsIds; State = state; }
public void RandomizeState() { State = G.Rnd.NextDouble() > 0.7f ? CellState.Alive : CellState.Dead; NextState = State; }
public string Visualize(CellState state) { return(state == CellState.Alive ? "■" : " "); }
public Cell(CellState cellState) { CellState = cellState; }