Exemple #1
0
    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.");
        }
    }
Exemple #2
0
 private void SetCellColor(GridCoordinate coordinates, BoardCellColor color)
 {
     m_board[coordinates.GetRow()][coordinates.GetColumn()] = color;
 }
Exemple #3
0
 public BoardCellColor GetCellColor(GridCoordinate coordinates)
 {
     return(m_board[coordinates.GetRow()][coordinates.GetColumn()]);
 }