8#include "games/Battleships.hpp"
9#include "games/Hangman.hpp"
10#include "games/TicTacToe.hpp"
11#include "helpers/Globals.hpp"
12#include "helpers/PageBuilder.hpp"
13#include "helpers/Terminal.hpp"
15#include "helpers/MainMenu.hpp"
28 for (
const std::string& argument : p_commandLineArguments)
30 if (argument ==
"--a" || argument ==
"--ascii-only")
36 if (argument ==
"-h" || argument ==
"--help")
55 uint32_t gameChoice = 0;
56 bool goToHomePage =
true;
Used to quit the main menu.
Used to quit the program.
std::vector< std::string > m_mainMenus
Contains the different options available on the main menu page.
void SetupHomepages()
Create the option selection home pages.
MainMenu()=delete
Disable constructing a new Main Menu object with no arguments.
void SetupMainMenuPagesAndGames()
Create the main menu game selection pages and the game array.
~MainMenu()
Destructs a MainMenu object.
bool m_useAnsiEscapeCodes
Whether to use use ANSI escapes codes (true) or only extended ASCII characters (false).
void Run()
Orchestration function which contains the main program loop.
std::vector< std::string > m_homepages
Contains the different options available on the homepage.
std::vector< std::unique_ptr< Game > > m_games
Games that can be selected and played.
Builds pages (i.e. strings) to be printed to the terminal.
std::vector< std::string > GetGameSelectionMainMenuPages(const std::vector< std::string > &p_gameNames) const
Creates the pages for displaying the main menu game selection page.
std::vector< std::string > GetOptionSelectionHomepages()
Creates the pages for displaying the option selection home page.
static void ResetTerminal()
Resets the terminal to its original state before the program was run.
static uint32_t GetUserChoiceFromMainMenus(const std::vector< std::string > &p_menus)
Get the user choice from a list of main menus screens that are printed to the terminal.
static bool GetUserChoiceFromHomepage(const std::vector< std::string > &p_menus, const bool &p_useAnsiEscapeCodes)
Get the user choice from a list of homepage screens that are printed to the terminal.
static void InitialiseTerminal()
Initialises the terminal for the program.
static const std::string G_MAIN_MENU_CLI_HELP_MESSAGE
CLI help message.
Contains all Terminal-Games objects.
@ MAINMENU
Page supported by PageBuilder.
@ HOMEPAGE
Page supported by PageBuilder.