示例#1
0
        private Cell GetCell(Coordinate coordinate)
        {
            var cell = Cells
                .Where(i => i.Coordinate == coordinate)
                .FirstOrDefault();

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

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