Implement a group of C++ classes that implements a game engine that controls the flow of the game by using the notion of state, transition, and command. The state represents a certain phase of the game and dictates what are the valid actions or user commands that take place in this phase. Some actions or commands may eventually trigger a transition to another state, which is what controls the flow of the game. All the classes/functions that you implement for this component must all reside in a single .cpp/.h file duo named GameEngine.cpp/GameEngine.h. You must deliver a file named GameEngineDriver.cpp file that contains a free function named testGameStates() that allows the user to type command strings on the console, whose result is to trigger some state transitions as depicted in the state transition diagram presented below. Any command string entered that does not correspond to an outgoing edge of the current state should be rejected.
[x] User enters commands a string on the program console, specified on the edges of the above graph.
[x] Control flow uses states as specified on the above graph.
[x] The correct commands trigger state transitions, as specified on the above graph.
[x] Incorrect commands result in an error message displayed on the console and do not result in a state transition.
[x] A free function named testGameStates() that creates a console-driven interface that allows the user to navigate through all the states by typing commands as stated in the above graph.
Implement a group of C++ classes that implements a game engine that controls the flow of the game by using the notion of state, transition, and command. The state represents a certain phase of the game and dictates what are the valid actions or user commands that take place in this phase. Some actions or commands may eventually trigger a transition to another state, which is what controls the flow of the game. All the classes/functions that you implement for this component must all reside in a single .cpp/.h file duo named GameEngine.cpp/GameEngine.h. You must deliver a file named GameEngineDriver.cpp file that contains a free function named testGameStates() that allows the user to type command strings on the console, whose result is to trigger some state transitions as depicted in the state transition diagram presented below. Any command string entered that does not correspond to an outgoing edge of the current state should be rejected.