Robot Devastation
Public Member Functions | Static Public Attributes | Protected Attributes | List of all members
rd::InitState Class Reference

Game Initial State. More...

#include <InitState.hpp>

Inheritance diagram for rd::InitState:
rd::State rd::ManagerHub rd::InputEventListener

Public Member Functions

 InitState (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...
 
- Public Member Functions inherited from rd::State
const std::string & getStateId () const
 Returns the string that identifies the state.
 
- Public Member Functions inherited from rd::ManagerHub
 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 Public Attributes

static const int LOGIN_SUCCESSFUL = 1
 
static const int EXIT_REQUESTED = 2
 

Protected Attributes

InitScreen screen
 
bool login
 
bool logged_in
 
bool received_exit
 
- Protected Attributes inherited from rd::State
std::string state_id
 Name of the current state.
 
- Protected Attributes inherited from rd::ManagerHub
NetworkManagernetworkManager
 
ImageManagerimageManager
 
InputManagerinputManager
 
MentalMapmentalMap
 
asrob::IRobotManager * robotManager
 
AudioManageraudioManager
 
ScreenManagerscreenManager
 

Additional Inherited Members

- Static Public Member Functions inherited from rd::State
static StategetEndState ()
 

Detailed Description

Behavior:

Member Function Documentation

◆ cleanup()

bool rd::InitState::cleanup ( )
virtual
Returns
False if some problem ocurred

Implements rd::State.

◆ evaluateConditions()

int rd::InitState::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::InitState::loop ( )
virtual
Returns
False if some problem ocurred

Implements rd::State.

◆ onKeyDown()

bool rd::InitState::onKeyDown ( const Key k)
virtual
Parameters
kKey that triggered the event

Implements rd::InputEventListener.

◆ onKeyUp()

bool rd::InitState::onKeyUp ( const Key k)
virtual
Parameters
kKey that triggered the event

Implements rd::InputEventListener.

◆ onWindowEvent()

bool rd::InitState::onWindowEvent ( const WindowEvent event)
virtual
Parameters
eventWindowEvent object that wraps the window event

Implements rd::InputEventListener.

◆ setup()

bool rd::InitState::setup ( )
virtual
Returns
False if some problem ocurred

Implements rd::State.


The documentation for this class was generated from the following files: