Terminal Games
Simple games that run in the terminal.
|
Orchestration class which runs the homepage and the main menu pages which allow for games to be ran. More...
#include "MainMenu.hpp"
Public Member Functions | |
MainMenu (const bool &p_useAnsiEscapeCodes) | |
Constructs a new MainMenu object (for API use). | |
MainMenu (const std::vector< std::string > &p_commandLineArguments) | |
Constructs a new MainMenu object (for CLI use). Below is the help message: | |
~MainMenu () | |
Destructs a MainMenu object. | |
void | Run () |
Orchestration function which contains the main program loop. | |
MainMenu ()=delete | |
Disable constructing a new Main Menu object with no arguments. | |
MainMenu (const MainMenu &p_mainMenu)=delete | |
Disable constructing a new MainMenu object using copy constructor. | |
MainMenu (const MainMenu &&p_mainMenu)=delete | |
Disable constructing a new MainMenu object using move constructor. | |
MainMenu & | operator= (const MainMenu &p_mainMenu)=delete |
Disable constructing a new MainMenu object using copy assignment operator. | |
MainMenu & | operator= (const MainMenu &&p_mainMenu)=delete |
Disable constructing a new MainMenu object using move assignment operator. |
Private Member Functions | |
void | SetupHomepages () |
Create the option selection home pages. | |
void | SetupMainMenuPagesAndGames () |
Create the main menu game selection pages and the game array. |
Private Attributes | |
std::vector< std::unique_ptr< Game > > | m_games |
Games that can be selected and played. | |
std::vector< std::string > | m_homepages |
Contains the different options available on the homepage. | |
std::vector< std::string > | m_mainMenus |
Contains the different options available on the main menu page. | |
bool | m_useAnsiEscapeCodes |
Whether to use use ANSI escapes codes (true) or only extended ASCII characters (false). |
Orchestration class which runs the homepage and the main menu pages which allow for games to be ran.
Definition at line 19 of file MainMenu.hpp.
|
explicit |
Constructs a new MainMenu object (for API use).
p_useAnsiEscapeCodes | Whether to use use ANSI escapes codes (true) or only extended ASCII characters (false). |
Definition at line 19 of file MainMenu.cpp.
|
explicit |
Constructs a new MainMenu object (for CLI use). Below is the help message:
Usage: terminal-games [options]
OPTIONS:
Generic Options:
-h –help Display available options.
Optional Options:
–a –ascii-only Only use extended ASCII characters (this removes all colour).
p_commandLineArguments | List of all command line arguments. |
Definition at line 25 of file MainMenu.cpp.
TerminalGames::MainMenu::~MainMenu | ( | ) |
Destructs a MainMenu object.
Definition at line 46 of file MainMenu.cpp.
|
delete |
Disable constructing a new MainMenu object using copy constructor.
p_mainMenu | The MainMenu to copy. |
|
delete |
Disable constructing a new MainMenu object using move constructor.
p_mainMenu | The MainMenu to copy. |
void TerminalGames::MainMenu::Run | ( | ) |
Orchestration function which contains the main program loop.
Definition at line 51 of file MainMenu.cpp.
Disable constructing a new MainMenu object using copy assignment operator.
p_mainMenu | The MainMenu to copy. |
Disable constructing a new MainMenu object using move assignment operator.
p_mainMenu | The MainMenu to copy. |
|
private |
Create the option selection home pages.
Definition at line 91 of file MainMenu.cpp.
|
private |
Create the main menu game selection pages and the game array.
Definition at line 97 of file MainMenu.cpp.
|
private |
Games that can be selected and played.
Definition at line 105 of file MainMenu.hpp.
|
private |
Contains the different options available on the homepage.
Definition at line 110 of file MainMenu.hpp.
|
private |
Contains the different options available on the main menu page.
Definition at line 115 of file MainMenu.hpp.
|
private |
Whether to use use ANSI escapes codes (true) or only extended ASCII characters (false).
Definition at line 120 of file MainMenu.hpp.