Trabalho Prático - PDS2
Carregando...
Procurando...
Nenhuma entrada encontrado
Referência da Classe Board

Membros Públicos

 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.
 

Atributos Privados

int _rows
 
int _cols
 
std::vector< std::vector< int > > _board
 

Construtores e Destrutores

◆ Board()

Board ( int r,
int c )

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
rThe number of rows in the board.
cThe number of columns in the board.

Documentação das funções

◆ getCols()

int getCols ( )

Get the number of columns in the board.

Retorna
int The number of columns.
Esse é o diagrama das funções que utilizam essa função:

◆ getElementAt()

char getElementAt ( int r,
int c )

Retrieves the element at the specified row and column in the board.

Parâmetros
rThe row index of the element to retrieve.
cThe column index of the element to retrieve.
Retorna
int The element at the specified row and column.
Esse é o diagrama das funções que utilizam essa função:

◆ getRows()

int getRows ( )

Get the number of rows in the board.

Retorna
int The number of rows.
Esse é o diagrama das funções que utilizam essa função:

◆ isWithinBounds()

bool isWithinBounds ( int r,
int c )

Checks if the given row and column indices are within the bounds of the board.

Parâmetros
rThe row index to check.
cThe column index to check.
Esse é o diagrama das funções que utilizam essa função:

◆ setPosition()

void setPosition ( int r,
int c,
char symbol )

Sets the symbol at the specified position on the board.

Parâmetros
rThe row index where the symbol will be placed.
cThe column index where the symbol will be placed.
symbolThe character symbol to be placed on the board.
Esse é o diagrama das funções que utilizam essa função:

A documentação para essa classe foi gerada a partir dos seguintes arquivos: