OOP A3 Board Games 35
a Board Game Project Made by Students at Cairo FCAI
Loading...
Searching...
No Matches
TicTacToe5x5_Board Class Reference

#include <TicTacToe5x5.h>

Inheritance diagram for TicTacToe5x5_Board:
Board< char >

Public Member Functions

 TicTacToe5x5_Board ()
bool update_board (Move< char > *move) override
 Update the board with a new move.
bool is_win (Player< char > *player) override
 Check if a player has won.
bool is_lose (Player< char > *player) override
 Check if a player has lost.
bool is_draw (Player< char > *player) override
 Check if the game ended in a draw.
bool game_is_over (Player< char > *player) override
 Check if the game is over.
Public Member Functions inherited from Board< char >
 Board (int rows, int columns)
 Construct a board with given dimensions.
virtual ~Board ()
 Virtual destructor. Frees allocated board memory.
vector< vector< char > > get_board_matrix () const
 Return a copy of the current board as a 2D vector.
int get_rows () const
 Get number of rows.
int get_columns () const
 Get number of columns.

Additional Inherited Members

Protected Attributes inherited from Board< char >
int rows
 Number of rows.
int columns
 Number of columns.
vector< vector< char > > board
 2D vector for the board
int n_moves
 Number of moves made.

Constructor & Destructor Documentation

◆ TicTacToe5x5_Board()

TicTacToe5x5_Board::TicTacToe5x5_Board ( )
inline

Member Function Documentation

◆ game_is_over()

bool TicTacToe5x5_Board::game_is_over ( Player< char > * )
inlineoverridevirtual

Check if the game is over.

Implements Board< char >.

◆ is_draw()

bool TicTacToe5x5_Board::is_draw ( Player< char > * )
inlineoverridevirtual

Check if the game ended in a draw.

Implements Board< char >.

◆ is_lose()

bool TicTacToe5x5_Board::is_lose ( Player< char > * )
inlineoverridevirtual

Check if a player has lost.

Implements Board< char >.

◆ is_win()

bool TicTacToe5x5_Board::is_win ( Player< char > * )
inlineoverridevirtual

Check if a player has won.

Implements Board< char >.

◆ update_board()

bool TicTacToe5x5_Board::update_board ( Move< char > * move)
inlineoverridevirtual

Update the board with a new move.

Parameters
moveThe move object containing position and symbol.
Returns
true if the move is valid and applied, false otherwise.

Implements Board< char >.


The documentation for this class was generated from the following file: