Peoplemon  0.1.0
Peoplemon 3 game source documentation
LoadGame.hpp
Go to the documentation of this file.
1 #ifndef GAME_STATES_LOADGAME_HPP
2 #define GAME_STATES_LOADGAME_HPP
3 
4 #include <BLIB/Render.hpp>
6 #include <Core/Maps/Map.hpp>
7 #include <Game/States/State.hpp>
8 
9 namespace game
10 {
11 namespace state
12 {
19 class LoadGame
20 : public State
21 , public bl::input::Listener {
22 public:
29  static bl::engine::State::Ptr create(core::system::Systems& systems);
30 
35  virtual ~LoadGame() = default;
36 
41  virtual const char* name() const override;
42 
48  virtual void activate(bl::engine::Engine& engine) override;
49 
55  virtual void deactivate(bl::engine::Engine& engine) override;
56 
63  virtual void update(bl::engine::Engine& engine, float dt, float) override;
64 
65 private:
66  enum LoadState { SelectingSave, ChooseAction, SaveDeleted, Fading, Error } state;
67 
68  std::vector<core::file::GameSave> saves;
69  unsigned int selectedSave;
70  bl::rc::res::TextureRef bgndTxtr;
71  bl::gfx::Sprite background;
72  bl::rc::rgi::FadeEffectTask* fadeout;
73 
74  bl::menu::Menu saveMenu;
75  bl::menu::Menu actionMenu;
76  core::input::MenuDriver inputDriver;
77  bl::rc::Scene* scene;
78 
80  void saveSelected(unsigned int save);
81  void errorDone();
82  void reset();
83 
84  virtual bool observe(const bl::input::Actor&, unsigned int activatedControl,
85  bl::input::DispatchType, bool eventTriggered) override;
86 };
87 
88 } // namespace state
89 } // namespace game
90 
91 #endif
bl::menu::TriggerDriver< Control::MoveUp, Control::MoveRight, Control::MoveDown, Control::MoveLeft, Control::Interact > MenuDriver
Helper typedef for Peoplemon specific menu driving.
Definition: MenuDriver.hpp:18
Parent namespace for all functionality unique to the game.
Owns all primary systems and a reference to the engine.
Definition: Systems.hpp:47
Provides a menu to select a save and loads the selected save.
Definition: LoadGame.hpp:21
virtual void activate(bl::engine::Engine &engine) override
Activates the state.
Definition: LoadGame.cpp:28
static bl::engine::State::Ptr create(core::system::Systems &systems)
Creates the load game state.
Definition: LoadGame.cpp:18
virtual ~LoadGame()=default
Destroy the New Game state.
virtual void deactivate(bl::engine::Engine &engine) override
Deactivates the state.
Definition: LoadGame.cpp:78
virtual void update(bl::engine::Engine &engine, float dt, float) override
Updates the state and menus and whatnot.
Definition: LoadGame.cpp:84
virtual const char * name() const override
Returns "LoadGame".
Definition: LoadGame.cpp:26
Parent to all game states. Provides some commonly required data like core game systems.
Definition: State.hpp:29
core::system::Systems & systems
Definition: State.hpp:66