Game Dead State.
More...
#include <DeadState.hpp>
|
| DeadState (NetworkManager *networkManager, ImageManager *imageManager, InputManager *inputManager, MentalMap *mentalMap, asrob::IRobotManager *robotManager, AudioManager *audioManager, ScreenManager *screenManager) |
|
virtual bool | setup () |
| Function executed just before the loop function, when the state is enabled. More...
|
|
virtual bool | loop () |
| Function executed periodically when the state is active. More...
|
|
virtual bool | cleanup () |
| Function excuted when this state is going to be stopped (due to an error or a transition) More...
|
|
virtual int | evaluateConditions () |
| This function is called after each call to loop() in order to know the transition to make. More...
|
|
virtual bool | onKeyDown (const Key &k) |
| This function will be called whenever a key is pressed on the keyboard. More...
|
|
virtual bool | onKeyUp (const Key &k) |
| This function will be called whenever a key is released on the keyboard. More...
|
|
virtual bool | onWindowEvent (const WindowEvent &event) |
| This function will be called whenever a window event is raised. More...
|
|
const std::string & | getStateId () const |
| Returns the string that identifies the state.
|
|
| ManagerHub (NetworkManager *networkManager, ImageManager *imageManager, InputManager *inputManager, MentalMap *mentalMap, asrob::IRobotManager *robotManager, AudioManager *audioManager, ScreenManager *screenManager) |
|
bool | setNetworkManager (NetworkManager *networkManager) |
|
bool | setImageManager (ImageManager *imageManager) |
|
bool | setInputManager (InputManager *inputManager) |
|
bool | setMentalMap (MentalMap *mentalMap) |
|
bool | setRobotManager (asrob::IRobotManager *robotManager) |
|
bool | setAudioManager (AudioManager *audioManager) |
|
bool | setScreenManager (ScreenManager *screenManager) |
|
|
static const int | RESPAWN_SELECTED = 1 |
|
static const int | EXIT_SELECTED = 2 |
|
static const int | DEFAULT_RATE_MS = 100 |
|
static const int | MAX_HEALTH = 100 |
|
|
static State * | getEndState () |
|
Behavior:
- Waits for 10 seconds showing dead screen
- Then, it enables input:
- When user presses enter, respawns the robot and goes to game state again
- When user presses q, logout the game
◆ cleanup()
bool rd::DeadState::cleanup |
( |
| ) |
|
|
virtual |
- Returns
- False if some problem ocurred
Implements rd::State.
◆ evaluateConditions()
int rd::DeadState::evaluateConditions |
( |
| ) |
|
|
virtual |
An integer value is assigned to each possible transition to identify them.
- Returns
- Transition selected depending on the conditions of the state
Implements rd::State.
◆ loop()
bool rd::DeadState::loop |
( |
| ) |
|
|
virtual |
- Returns
- False if some problem ocurred
Implements rd::State.
◆ onKeyDown()
bool rd::DeadState::onKeyDown |
( |
const Key & |
k | ) |
|
|
virtual |
◆ onKeyUp()
bool rd::DeadState::onKeyUp |
( |
const Key & |
k | ) |
|
|
virtual |
◆ onWindowEvent()
bool rd::DeadState::onWindowEvent |
( |
const WindowEvent & |
event | ) |
|
|
virtual |
◆ setup()
bool rd::DeadState::setup |
( |
| ) |
|
|
virtual |
- Returns
- False if some problem ocurred
Implements rd::State.
The documentation for this class was generated from the following files:
- src/libraries/GameStatesLib/DeadState.hpp
- src/libraries/GameStatesLib/DeadState.cpp