private void ValidateGridIndexRange(GridCoordinate coordinates) { var size = m_board.GetBoardSize(); var isInRowRange = coordinates.GetRow() >= 0 && coordinates.GetRow() < size; var isInColumnRange = coordinates.GetColumn() >= 0 && coordinates.GetColumn() < size; if (!isInRowRange || !isInColumnRange) { throw new Exception("Out of Grid range."); } }
private void SetCellColor(GridCoordinate coordinates, BoardCellColor color) { m_board[coordinates.GetRow()][coordinates.GetColumn()] = color; }
public BoardCellColor GetCellColor(GridCoordinate coordinates) { return(m_board[coordinates.GetRow()][coordinates.GetColumn()]); }