Ejemplo n.º 1
0
        private Cell GetCell(Coordinate coordinate)
        {
            var cell = Cells
                .Where(i => i.Coordinate == coordinate)
                .FirstOrDefault();

            if (cell == null)
            {
                throw new CellNotFoundException();
            }

            return cell;
        }
Ejemplo n.º 2
0
 private void SetCellState(Coordinate coordinate, CellState cellState)
 {
     GetCell(coordinate).State = cellState;
 }
Ejemplo n.º 3
0
 public void MakeCellAlive(Coordinate coordinate)
 {
     SetCellState(coordinate, CellState.Alive);
 }
Ejemplo n.º 4
0
 public void MakeCellDead(Coordinate coordinate)
 {
     SetCellState(coordinate, CellState.Dead);
 }
Ejemplo n.º 5
0
 public CellState GetCellState(Coordinate coordinate)
 {
     return GetCell(coordinate).State;
 }