![]() |
OOP A3 Board Games 35
a Board Game Project Made by Students at Cairo FCAI
|
Base class for handling user interface and input/output. More...
#include <BoardGame_Classes.h>
Public Member Functions | |
| UI (string message, int cell_display_width) | |
| Construct the UI and display a welcome message. | |
| virtual | ~UI () |
| void | display_message (string message) |
| Display any message to the user. | |
| virtual Move< T > * | get_move (Player< T > *)=0 |
| Ask the user (or AI) to make a move. | |
| virtual Player< T > ** | setup_players () |
| Set up players for the game. | |
| virtual Player< T > * | create_player (string &name, T symbol, PlayerType type)=0 |
| Create a player object based on input name, symbol, and type. | |
| void | display_board_matrix (const vector< vector< T > > &matrix) const |
| Display the current board matrix in formatted form. | |
Protected Member Functions | |
| string | get_player_name (string player_label) |
| Ask the user for the player's name. | |
| PlayerType | get_player_type_choice (string player_label, const vector< string > &options) |
| Ask the user to choose the player type from a list. | |
Protected Attributes | |
| int | cell_width |
| Width of each displayed board cell. | |
Base class for handling user interface and input/output.
| T | The type of symbol used on the board. |
|
inline |
Construct the UI and display a welcome message.
|
pure virtual |
Create a player object based on input name, symbol, and type.
Implemented in FourUI, Numerical_UI, SUSUI, and TicTacToe4x4_UI.
|
inline |
Display the current board matrix in formatted form.
|
inline |
Display any message to the user.
Ask the user (or AI) to make a move.
Implemented in DiamondTicTacToe_UI, FourInARowUI, FourUI, InfinityTicTacToe_UI, MemoryTicTacToe_UI, MisereTicTacToe_UI, Numerical_UI, NumericalTicTacToeUI, ObstaclesTicTacToe_UI, Pyramic_XO_UI, SUS_UI, SUSUI, TicTacToe4x4_UI, TicTacToe5x5_UI, UltimateTicTacToe_UI, word_UI, and XO_UI.
|
inlineprotected |
Ask the user for the player's name.
|
inlineprotected |
Ask the user to choose the player type from a list.
Set up players for the game.
Default implementation of setting up two players.
|
protected |
Width of each displayed board cell.