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
8class 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
Definição board.hpp:8
int getRows()
Get the number of rows in the board.
Definição board.cpp:30
char getElementAt(int r, int c)
Retrieves the element at the specified row and column in the board.
Definição board.cpp:41
Board(int r, int c)
Constructs a Board object with the specified number of rows and columns.
Definição board.cpp:12
bool isBoardFull()
Checks if the board is completely filled.
Definição board.cpp:59
int getCols()
Get the number of columns in the board.
Definição board.cpp:21
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
void setPosition(int r, int c, char symbol)
Sets the symbol at the specified position on the board.
Definição board.cpp:52