Trabalho Prático - PDS2
Carregando...
Procurando...
Nenhuma entrada encontrado
board.hpp
1
#ifndef BOARD_HPP
2
#define BOARD_HPP
3
4
#include <iostream>
5
#include <vector>
6
#include <memory>
7
8
class
Board
{
9
private
:
10
int
_rows;
11
int
_cols;
12
std::vector<std::vector<int>> _board;
13
14
public
:
15
16
Board
(
int
r,
int
c);
17
18
int
getCols
();
19
int
getRows
();
20
21
char
getElementAt
(
int
r,
int
c);
22
23
void
setPosition
(
int
r,
int
c,
char
symbol);
24
25
bool
isBoardFull
();
26
27
bool
isWithinBounds
(
int
r,
int
c);
28
};
29
30
#endif
Board
Definição
board.hpp:8
Board::getRows
int getRows()
Get the number of rows in the board.
Definição
board.cpp:30
Board::getElementAt
char getElementAt(int r, int c)
Retrieves the element at the specified row and column in the board.
Definição
board.cpp:41
Board::Board
Board(int r, int c)
Constructs a Board object with the specified number of rows and columns.
Definição
board.cpp:12
Board::isBoardFull
bool isBoardFull()
Checks if the board is completely filled.
Definição
board.cpp:59
Board::getCols
int getCols()
Get the number of columns in the board.
Definição
board.cpp:21
Board::isWithinBounds
bool isWithinBounds(int r, int c)
Checks if the given row and column indices are within the bounds of the board.
Definição
board.cpp:75
Board::setPosition
void setPosition(int r, int c, char symbol)
Sets the symbol at the specified position on the board.
Definição
board.cpp:52
include
game
board.hpp
Gerado por
1.10.0