Peoplemon  0.1.0
Peoplemon 3 game source documentation
BattleState.hpp
Go to the documentation of this file.
1 #ifndef GAME_STATES_BATTLESTATE_HPP
2 #define GAME_STATES_BATTLESTATE_HPP
3 
8 #include <Game/States/State.hpp>
9 
10 namespace game
11 {
12 namespace state
13 {
21 : public State
22 , public bl::event::Listener<core::event::OpenPeoplemonMenu, core::event::OpenBagMenu> {
23 public:
31  static bl::engine::State::Ptr create(core::system::Systems& systems,
32  std::unique_ptr<core::battle::Battle>&& battle);
33 
37  virtual ~BattleState() = default;
38 
42  virtual const char* name() const override;
43 
47  virtual void activate(bl::engine::Engine&) override;
48 
52  virtual void deactivate(bl::engine::Engine&) override;
53 
59  virtual void update(bl::engine::Engine&, float dt, float) override;
60 
61 private:
62  std::unique_ptr<core::battle::Battle> battle;
63  bl::rc::SceneRef scene;
64 
65  BattleState(core::system::Systems& systems, std::unique_ptr<core::battle::Battle>&& battle);
66 
67  virtual void observe(const core::event::OpenPeoplemonMenu& event) override;
68  virtual void observe(const core::event::OpenBagMenu& event) override;
69 };
70 
71 } // namespace state
72 } // namespace game
73 
74 #endif
Parent namespace for all functionality unique to the game.
Event that is fired when the bag menu should be opened.
Definition: BagMenu.hpp:16
Special event to trigger the opening of the peoplemon menu.
Owns all primary systems and a reference to the engine.
Definition: Systems.hpp:47
This game state does all battling. When the battle is complete it will pop itself from the engine sta...
Definition: BattleState.hpp:22
virtual const char * name() const override
Returns "BattleState".
Definition: BattleState.cpp:50
virtual void deactivate(bl::engine::Engine &) override
Does nothing.
Definition: BattleState.cpp:63
static bl::engine::State::Ptr create(core::system::Systems &systems, std::unique_ptr< core::battle::Battle > &&battle)
Creates a new BattleState.
Definition: BattleState.cpp:34
virtual void activate(bl::engine::Engine &) override
Does nothing.
Definition: BattleState.cpp:52
virtual ~BattleState()=default
Destroy the Battle State object.
virtual void update(bl::engine::Engine &, float dt, float) override
Calls into the battle's update method.
Definition: BattleState.cpp:70
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