8#include "helpers/GameInformation.hpp"
9#include "helpers/PageBuilder.hpp"
64 static uint32_t
GetUserChoiceFromGameMenus(
const std::vector<std::string>& p_menus,
const std::vector<std::string>& p_quitOptionMenus);
85 const std::tuple<uint32_t, uint32_t>& p_startingGridLocation,
88 const bool& p_displayGetUserCommandPage);
108 const std::tuple<uint32_t, uint32_t>& p_startingGridLocation,
111 const bool& p_displayGetUserCommandPage);
131 const std::tuple<uint32_t, uint32_t>& p_startingGridLocation,
134 const bool& p_displayGetUserCommandPage);
170 static void PrintOutput(
const std::string& p_output);
Builds pages (i.e. strings) to be printed to the terminal.
static void GetUserChoiceFromGameOverMenu(const std::string &p_gameOverPage, const std::vector< std::string > &p_quitOptionMenus)
Get the user choice whether to restart the game, reset the game or a choice from the GetUserChoiceFro...
static void SetCursorVisibility(const bool &p_cursorVisibility)
Wrapper around the <Windows.h> API for the SetConsoleCursorInfo() function.
static std::tuple< uint32_t, uint32_t > GetUserCommandFromGameGridWindows(const std::tuple< uint32_t, uint32_t > &p_startingGridLocation, const PageBuilder &p_pageBuilder, const GameInformation &p_gameInformation, const bool &p_displayGetUserCommandPage)
(Windows) Gets a user command based on the currently displayed game grid.
static uint32_t GetNextKeyPress()
Wrapper for <Windows.h> API for the FlushConsoleInputBuffer() and _getch() functions.
static void PrintOutput(const std::string &p_output)
Clears and then prints to the terminal.
static uint32_t GetUserChoiceFromGameMenus(const std::vector< std::string > &p_menus, const std::vector< std::string > &p_quitOptionMenus)
Get the user choice from a list of game menus screens that are printed to the terminal.
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 std::tuple< uint32_t, uint32_t > GetUserCommandFromGameGridNonWindows(const std::tuple< uint32_t, uint32_t > &p_startingGridLocation, const PageBuilder &p_pageBuilder, const GameInformation &p_gameInformation, const bool &p_displayGetUserCommandPage)
(Non-window) Gets a user command based on the currently displayed game grid.
static void Clear()
Clears the terminal based on this article: https://www.cplusplus.com/articles/4z18T05o.
static std::tuple< uint32_t, uint32_t > GetUserCommandFromGameGrid(const std::tuple< uint32_t, uint32_t > &p_startingGridLocation, const PageBuilder &p_pageBuilder, const GameInformation &p_gameInformation, const bool &p_displayGetUserCommandPage)
Gets a user command based on the currently displayed game grid (wrapper function around the platform-...
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 void SetCursorPosition(const int16_t &p_xCoord, const int16_t &p_yCoord)
Wrapper around the <Windows.h> API for the SetConsoleCursorPosition() function.
Terminal()=delete
Disable constructing a Terminal object.
static void GetUserChoiceFromQuitMenus(const std::vector< std::string > &p_menus)
Gets the user choice from the quit menu. All user choices result in a different custom exception bein...
Contains all Terminal-Games objects.