|
| | Board (int r, int c) |
| | Constructs a Board object with the specified number of rows and columns.
|
| |
| int | getCols () |
| | Get the number of columns in the board.
|
| |
| int | getRows () |
| | Get the number of rows in the board.
|
| |
| char | getElementAt (int r, int c) |
| | Retrieves the element at the specified row and column in the board.
|
| |
| void | setPosition (int r, int c, char symbol) |
| | Sets the symbol at the specified position on the board.
|
| |
|
bool | isBoardFull () |
| | Checks if the board is completely filled.
|
| |
| bool | isWithinBounds (int r, int c) |
| | Checks if the given row and column indices are within the bounds of the board.
|
| |
|
|
int | _rows |
| |
|
int | _cols |
| |
|
std::vector< std::vector< int > > | _board |
| |
◆ Board()
Constructs a Board object with the specified number of rows and columns.
This constructor initializes a 2D board with the given number of rows and columns. Each cell in the board is dynamically allocated.
- Parâmetros
-
| r | The number of rows in the board. |
| c | The number of columns in the board. |
◆ getCols()
Get the number of columns in the board.
- Retorna
int The number of columns.
◆ getElementAt()
| char getElementAt |
( |
int | r, |
|
|
int | c ) |
Retrieves the element at the specified row and column in the board.
- Parâmetros
-
| r | The row index of the element to retrieve. |
| c | The column index of the element to retrieve. |
- Retorna
int The element at the specified row and column.
◆ getRows()
Get the number of rows in the board.
- Retorna
int The number of rows.
◆ isWithinBounds()
| bool isWithinBounds |
( |
int | r, |
|
|
int | c ) |
Checks if the given row and column indices are within the bounds of the board.
- Parâmetros
-
| r | The row index to check. |
| c | The column index to check. |
◆ setPosition()
| void setPosition |
( |
int | r, |
|
|
int | c, |
|
|
char | symbol ) |
Sets the symbol at the specified position on the board.
- Parâmetros
-
| r | The row index where the symbol will be placed. |
| c | The column index where the symbol will be placed. |
| symbol | The character symbol to be placed on the board. |
A documentação para essa classe foi gerada a partir dos seguintes arquivos: