8#include "games/Game.hpp"
9#include "helpers/GameInformation.hpp"
10#include "helpers/PageBuilder.hpp"
30 explicit Hangman(
const bool& p_useAnsiEscapeCodes);
Game()=default
Constructs a new Game object.
void GetWordFromComputer()
Gets a random word, from the word list loaded during the setup, when the computer is the word setter.
void GetUserPlayerChoice()
Prompts the user to select which player the will be playing the game as (only supported if playing ag...
uint32_t m_turnCount
The number of turns that have occurred.
void ToggleCurrentPlayer() override
Change the current player to the other player.
void UpdateGameInformation() override
Updates GameInformation to match the current state of the game.
void ExecuteUserCommand() override
Prompt the user to enter their command for the current turn.
bool IsGameOver() override
Check whether the game is over.
void SetupGame() override
Clears and sets all member variables to their game start default.
Hangman(const bool &p_useAnsiEscapeCodes)
Constructs a new Hangman object.
void GameOver() override
Display the game over message and prompt the user whether they would like to play again or quit the g...
void ExecuteComputerCommand() override
Get a random command from the computer.
uint32_t m_computerSpeed
The computer speed determined by the amount of seconds the computer must wait before executing it's c...
std::string m_userPlayerChoice
The choice of whether the user has selected to be the guesser or word setter.
void GetUserOptions() override
Prompt the user for their choice on various game-related options.
PageBuilder m_pageBuilder
Used to build pages required by the game.
bool m_isGameOver
Whether the game is over (true) or not (false).
void GetComputerSpeed()
Prompts the user to select how the speed of the computer decision making (this does not affect the di...
void RestartGame() override
Update variables to allow for the game to be restarted with the same user options.
void ResetGame() override
Update variables to allow for the game to be reset and so the user will be asked for new options.
GameInformation m_gameInformation
Used to package up the current state of the game so it can be used by m_pageBuilder.
std::string m_playerCount
The count of the user selected number of players.
std::vector< char > m_commandsRemaining
The letters which remain to be guessed.
std::default_random_engine m_randomNumberGenerator
Used to randomly select the word to be guessed from Globals::G_HANGMAN_COMPUTER_WORDS when the comput...
bool m_hasSavedGameOptions
Whether the user has selected all the game options (true) or not/partially (false)....
std::string m_currentGuessOfWord
The current guess state of the word to be guessed from the perspective of the guesser.
std::vector< char > m_incorrectGuesses
The letters which were guessed by the guesser and are incorrect.
bool IsCurrentTurnUsers() override
Check whether the current turn should be executed by the user.
void GetWordFromUser()
Prompts the user to enter a word to be guessed (whether the word is actually a word is not checked) w...
bool m_saveGameOptions
Whether to save the user's currently selected game options (true) and restart the game or not (false)...
std::string m_computerSpeedName
The name of the user selected computer speed.
std::string m_wordToBeGuessed
The word to be guessed by the guesser.
void ExecuteGeneralCommand(const char &p_guess)
Checks the single-letter guess against the word, updates the current guess of the word and the error ...
void GetPlayerCount()
Prompts the user to select how many players will be playing the game.
char m_currentLetterSelected
The letter to display to the user to represent what their current selected guess is.
Builds pages (i.e. strings) to be printed to the terminal.
Contains all Terminal-Games objects.