7#include "helpers/GameInformation.hpp"
8#include "helpers/Globals.hpp"
169 static std::string
RemoveColour(
const std::string& p_input);
253 std::string
GetRemainingEmptyLines(
const std::string& p_commonTopString,
const std::string& p_commonBottomString)
const;
267 const std::vector<std::string>& p_options,
268 const std::string& p_commonTopString,
269 const std::string& p_commonBottomString,
270 const bool& p_addEmptyLineBetweenOptions,
271 const bool& p_centerOptionsHorizontally,
272 const bool& p_centerOptionsVertically)
const;
333 std::string
GetGridLayout(
const std::vector<uint32_t>& p_gridColumnWidths,
const std::vector<std::vector<std::string>>& p_gridColumnLines,
const uint32_t& p_gridColumnHeight);
std::string GetGeneralGameSubPage(const GameInformation &p_gameInformation)
Wrapper function around the game specific game sub-page functions.
std::string GetNewLineCentredOptimised(const std::string &p_input) const
Creates a new line on a page with p_input automatically centred. If the spacing on the sides is unequ...
std::string GetGridLayout(const std::vector< uint32_t > &p_gridColumnWidths, const std::vector< std::vector< std::string > > &p_gridColumnLines, const uint32_t &p_gridColumnHeight)
Calculates a grid layout based on the grid content in p_gridColumnLines and the grid sizes in p_gridC...
void SetProperties(const Pages &p_page, const bool &p_useAnsiEscapeCodes)
Set the properties of the PageBuilder object.
std::string GetPageWithMessage(const GameInformation &p_gameInformation, const std::string &p_message)
Creates a general game page with a custom message to display on the page.
std::string GetTopBox() const
Creates the top box display which acts as the title bar for a page.
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::string GetEmptyLine() const
Creates a new line on a page but with no input text.
std::vector< std::string > GetOptionSelectionHomepages()
Creates the pages for displaying the option selection home page.
static std::string RemoveColour(const std::string &p_input)
Removes colour from the input text by removing all ANSI colour escape codes.
Pages m_currentPage
The current page type to build for.
uint32_t m_lineMaximumCharacterCount
The maximum number of characters (excluding page edge and padding characters) that can exist within a...
std::string GetTopLine() const
Creates the top line of a box within a page.
uint32_t m_pageHeight
The page height in terms of the total number of lines (inclusive of the page edge lines).
std::string GetComputerCommandPage(const GameInformation &p_gameInformation)
Creates the computer command page for when the computer is entering their command.
std::string GetBottomBox() const
Creates the bottom box which acts as the footer for a page.
uint32_t m_minimumRightPadding
The minimum amount of padding between the edge characters of the page and the inner content.
std::string GetNewLineLeftJustified(const std::string &p_input, const Globals::Colours &p_colour=Globals::Colours::WHITE, const std::string &p_selector="") const
Creates a new line on a page with p_input automatically left justified (with one space padding on to ...
std::string GetBattleshipsSubPage(const GameInformation &p_gameInformation)
Creates the sub-page containing the current state of the Battleships game.
std::string GetBottomLine() const
Creates the bottom line of a box within a page.
std::vector< std::string > GetGeneralOptionSelectionPages(const std::vector< std::string > &p_options, const std::string &p_commonTopString, const std::string &p_commonBottomString, const bool &p_addEmptyLineBetweenOptions, const bool &p_centerOptionsHorizontally, const bool &p_centerOptionsVertically) const
Creates the pages for displaying the option selection page for the given options.
std::string m_topTitle
The text to display in the top box which acts as the title bar within a page.
std::string m_bottomTitle
The text to display in the bottom box which acts as a footer of a page.
std::string GetHangmanSubPage(const GameInformation &p_gameInformation)
Creates the sub-page containing the current state of the Hangman game.
std::string GetGameOverPage(const GameInformation &p_gameInformation)
Creates the game over page.
std::vector< std::string > GetUserPlayerChoiceOptionSelectionGamePages(const GameInformation &p_gameInformation)
Creates the pages for displaying the user player choice for a game option selection page.
std::string AddColour(const std::string &p_input, const Globals::Colours &p_colour) const
Sets the colour of p_input using ANSI escape codes.
std::string GetNewLineCentred(const std::string &p_input, const Globals::Colours &p_colour=Globals::Colours::WHITE, const std::string &p_selector="") const
Creates a new line on a page with p_input automatically centred. If the spacing on the sides is unequ...
std::vector< std::string > GetQuitOptionSelectionPage() const
Creates the quit option selection page.
std::vector< std::string > GetPlayerCountOptionSelectionGamePages(const GameInformation &p_gameInformation)
Creates the pages for displaying the number of players playing the game option selection page.
std::string GetTicTacToeSubPage(const GameInformation &p_gameInformation)
Creates the sub-page containing the current state of the TicTacToe game.
Pages GetCurrentPageType() const
Get the current page type.
std::string GetRemainingEmptyLines(const std::string &p_commonTopString, const std::string &p_commonBottomString) const
Used to pad a page vertically with empty lines.
uint32_t m_minimumLeftPadding
The minimum amount of padding between the edge characters of the page and the inner content.
std::vector< std::string > GetGameOptionSelectionPages(const GameInformation &p_gameInformation, const std::string &p_message, const std::vector< std::string > &p_options)
Creates the pages for displaying the option selection page for the given options within a game page.
std::vector< std::string > GetComputerSpeedOptionSelectionGamePages(const GameInformation &p_gameInformation)
Creates the pages for displaying the computer speed for a game option selection page.
uint32_t m_pageWidth
The page width in terms of the total number of characters (inclusive of the page edge characters) per...
std::string GetUserCommandPage(const GameInformation &p_gameInformation)
Creates the game user command page which should prompt the user to enter a command.
bool m_useAnsiEscapeCodes
Whether to use use ANSI escapes codes (true) or only extended ASCII characters (false).
PageBuilder()
Constructs a new default PageBuilder object.
Colours
Colours representing ANSI escape codes.
@ WHITE
Supported ANSI escape colour.
Contains all Terminal-Games objects.
Pages
Represents the page types that are supported by PageBuilder.
@ MAINMENU
Page supported by PageBuilder.
@ HOMEPAGE
Page supported by PageBuilder.
@ DEFAULT
Page supported by PageBuilder.
@ TICTACTOE
Page supported by PageBuilder.
@ HANGMAN
Page supported by PageBuilder.
@ BATTLESHIPS
Page supported by PageBuilder.