Game State.
More...
#include <GameState.hpp>
|
| GameState (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...
|
|
virtual bool | onImageArrived (ImageManager *manager) |
| This function will be called whenever a image arrives to the ImageManager. 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 | KILLED = 1 |
|
static const int | EXIT_REQUESTED = 2 |
|
static const Key | KEY_EXIT = rd::Key::KEY_ESCAPE |
|
static const Key | KEY_SHOOT = rd::Key::KEY_SPACE |
|
static const Key | KEY_RELOAD = 'r' |
|
static const Key | KEY_MOVE_FWD = 'w' |
|
static const Key | KEY_MOVE_BACK = 's' |
|
static const Key | KEY_TURN_LEFT = 'a' |
|
static const Key | KEY_TURN_RIGHT = 'd' |
|
static const Key | KEY_PAN_LEFT = rd::Key::KEY_ARROW_LEFT |
|
static const Key | KEY_PAN_RIGHT = rd::Key::KEY_ARROW_RIGHT |
|
static const Key | KEY_TILT_UP = rd::Key::KEY_ARROW_UP |
|
static const Key | KEY_TILT_DOWN = rd::Key::KEY_ARROW_DOWN |
|
|
static State * | getEndState () |
|
Behavior:
- Manages game interaction (movement, hits, player info updates)
- When user presses the Esc key, logs out
- It also plays music (important)
◆ cleanup()
bool rd::GameState::cleanup |
( |
| ) |
|
|
virtual |
- Returns
- False if some problem ocurred
Implements rd::State.
◆ evaluateConditions()
int rd::GameState::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::GameState::loop |
( |
| ) |
|
|
virtual |
- Returns
- False if some problem ocurred
Implements rd::State.
◆ onImageArrived()
bool rd::GameState::onImageArrived |
( |
ImageManager * |
manager | ) |
|
|
virtual |
◆ onKeyDown()
bool rd::GameState::onKeyDown |
( |
const Key & |
k | ) |
|
|
virtual |
◆ onKeyUp()
bool rd::GameState::onKeyUp |
( |
const Key & |
k | ) |
|
|
virtual |
◆ onWindowEvent()
bool rd::GameState::onWindowEvent |
( |
const WindowEvent & |
event | ) |
|
|
virtual |
◆ setup()
bool rd::GameState::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/GameState.hpp
- src/libraries/GameStatesLib/GameState.cpp