private Cell GetCell(Coordinate coordinate) { var cell = Cells .Where(i => i.Coordinate == coordinate) .FirstOrDefault(); if (cell == null) { throw new CellNotFoundException(); } return cell; }
private void SetCellState(Coordinate coordinate, CellState cellState) { GetCell(coordinate).State = cellState; }
public void MakeCellAlive(Coordinate coordinate) { SetCellState(coordinate, CellState.Alive); }
public void MakeCellDead(Coordinate coordinate) { SetCellState(coordinate, CellState.Dead); }
public CellState GetCellState(Coordinate coordinate) { return GetCell(coordinate).State; }