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

#include <SUSBoard.h>

Inheritance diagram for SUSBoard:
Board< char >

Public Member Functions

 SUSBoard ()
int count_xux ()
bool update_board (Move< char > *m) override
 Update the board with a new move.
bool full ()
bool is_win (Player< char > *p) override
 Check if a player has won.
bool is_lose (Player< char > *p) override
 Check if a player has lost.
bool is_draw (Player< char > *p) override
 Check if the game ended in a draw.
bool game_is_over (Player< char > *p) override
 Check if the game is over.
vector< vector< char > > get_board_matrix () const
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

◆ SUSBoard()

SUSBoard::SUSBoard ( )
inline

Member Function Documentation

◆ count_xux()

int SUSBoard::count_xux ( )
inline

◆ full()

bool SUSBoard::full ( )
inline

◆ game_is_over()

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

Check if the game is over.

Implements Board< char >.

◆ get_board_matrix()

vector< vector< char > > SUSBoard::get_board_matrix ( ) const
inline

◆ is_draw()

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

Check if the game ended in a draw.

Implements Board< char >.

◆ is_lose()

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

Check if a player has lost.

Implements Board< char >.

◆ is_win()

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

Check if a player has won.

Implements Board< char >.

◆ update_board()

bool SUSBoard::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: