Robot Devastation
InitState.hpp
1 // Authors: see AUTHORS.md at project root.
2 // CopyPolicy: released under the terms of the LGPLv2.1, see LICENSE at project root.
3 // URL: https://github.com/asrob-uc3m/robotDevastation
4 
5 #ifndef __RD_INIT_STATE_HPP__
6 #define __RD_INIT_STATE_HPP__
7 
8 #include "State.hpp"
9 #include "ManagerHub.hpp"
10 #include "InputEventListener.hpp"
11 #include "NetworkManager.hpp"
12 #include "ImageManager.hpp"
13 #include "InputManager.hpp"
14 #include "MentalMap.hpp"
15 #include "IRobotManager.hpp"
16 #include "AudioManager.hpp"
17 #include "ScreenManager.hpp"
18 #include "Key.hpp"
19 #include "WindowEvent.hpp"
20 #include "InitScreen.hpp"
21 
22 namespace rd{
23 
36 class InitState : public State, public ManagerHub, public InputEventListener
37 {
38  public:
39  //InitState();
40  InitState(NetworkManager * networkManager, ImageManager * imageManager,
41  InputManager * inputManager, MentalMap * mentalMap,
42  asrob::IRobotManager * robotManager, AudioManager * audioManager,
43  ScreenManager * screenManager);
44  virtual ~InitState();
45  virtual bool setup();
46  virtual bool loop();
47  virtual bool cleanup();
48  virtual int evaluateConditions();
49 
50  static const int LOGIN_SUCCESSFUL;
51  static const int EXIT_REQUESTED;
52 
53  //-- InputEventListener interface:
54  virtual bool onKeyDown(const Key & k);
55  virtual bool onKeyUp(const Key & k);
56  virtual bool onWindowEvent(const WindowEvent & event);
57 
58  protected:
59  InitScreen screen;
60  bool login;
61  bool logged_in;
62  bool received_exit;
63 
64 
65 };
66 
67 
68 }
69 #endif // __RD_INIT_STATE_HPP__
rd::MentalMap
Mental map is a repository for information about the players, targets and weapons.
Definition: MentalMap.hpp:38
rd::AudioManager
Music and sound effects manager.
Definition: AudioManager.hpp:28
rd
The main, catch-all namespace for Robot Devastation.
Definition: groups.dox:4
rd::InitState::cleanup
virtual bool cleanup()
Function excuted when this state is going to be stopped (due to an error or a transition)
Definition: InitState.cpp:79
rd::InitState::onWindowEvent
virtual bool onWindowEvent(const WindowEvent &event)
This function will be called whenever a window event is raised.
Definition: InitState.cpp:131
rd::InitState::onKeyUp
virtual bool onKeyUp(const Key &k)
This function will be called whenever a key is released on the keyboard.
Definition: InitState.cpp:113
rd::InputEventListener
Interface for objects that can be notified of input events by the InputManager.
Definition: InputEventListener.hpp:20
rd::InitState::loop
virtual bool loop()
Function executed periodically when the state is active.
Definition: InitState.cpp:56
rd::InitScreen
A User Interface.
Definition: InitScreen.hpp:22
rd::InitState::setup
virtual bool setup()
Function executed just before the loop function, when the state is enabled.
Definition: InitState.cpp:32
rd::Key
Class that represents a keyboard key.
Definition: Key.hpp:23
rd::State
Base class for each of the states of a FiniteStateMachine.
Definition: State.hpp:18
rd::InitState::onKeyDown
virtual bool onKeyDown(const Key &k)
This function will be called whenever a key is pressed on the keyboard.
Definition: InitState.cpp:108
rd::InputManager
User input manager (keyboard, mouse, joysticks, etc)
Definition: InputManager.hpp:35
rd::InitState::evaluateConditions
virtual int evaluateConditions()
This function is called after each call to loop() in order to know the transition to make.
Definition: InitState.cpp:97
rd::ManagerHub
A classs to interface all the robotDevastation managers. As some classes, such as the game states,...
Definition: ManagerHub.hpp:28
rd::ScreenManager
Manage game screens.
Definition: ScreenManager.hpp:35
rd::WindowEvent
Class that represents a window event.
Definition: WindowEvent.hpp:19
rd::InitState
Game Initial State.
Definition: InitState.hpp:36
rd::NetworkManager
Manages the communications between the user and the RobotDevastation network.
Definition: NetworkManager.hpp:37
rd::ImageManager
Generic image input manager.
Definition: ImageManager.hpp:39