Peoplemon  0.1.0
Peoplemon 3 game source documentation
Battle.hpp
Go to the documentation of this file.
1 #ifndef GAME_BATTLES_BATTLE_HPP
2 #define GAME_BATTLES_BATTLE_HPP
3 
9 #include <memory>
10 
11 namespace core
12 {
14 namespace battle
15 {
23 struct Battle {
25  enum struct Type { WildPeoplemon, Trainer, Online };
26 
36  static std::unique_ptr<Battle> create(bl::engine::Engine& engine, const std::string& location,
38 
44  void setController(std::unique_ptr<BattleController>&& controller);
45 
46  const std::string location;
48  const Type type;
50  std::unique_ptr<BattleController> controller;
52  Result result; // set by controller
53 
54 private:
55  Battle(bl::engine::Engine& engine, const std::string& location, system::Player& player,
56  Type type);
57 };
58 
59 } // namespace battle
60 } // namespace core
61 
62 #endif
Core classes and functionality for both the editor and game.
Convenience struct that owns all the components required for a battle and resolves some boilerplate s...
Definition: Battle.hpp:23
const Type type
Definition: Battle.hpp:48
static std::unique_ptr< Battle > create(bl::engine::Engine &engine, const std::string &location, system::Player &player, Type type)
Creates the battle struct and initializes the player battler.
Definition: Battle.cpp:42
system::Player & player
Definition: Battle.hpp:47
Type
Represents the different types of battles. Affects only the intro.
Definition: Battle.hpp:25
void setController(std::unique_ptr< BattleController > &&controller)
Sets and initializes the controller to use in battle.
Definition: Battle.cpp:55
BattleView view
Definition: Battle.hpp:51
BattleState state
Definition: Battle.hpp:49
std::unique_ptr< BattleController > controller
Definition: Battle.hpp:50
const std::string location
Definition: Battle.hpp:46
Stores and represents the current state of a battle. This is the base class for local and remote batt...
Definition: BattleState.hpp:18
This is the top level class for rendering battles. It takes commands and state from a BattleControlle...
Definition: BattleView.hpp:29
Represents the result of a battle.
Definition: Result.hpp:16
Primary system for managing the player and their data.
Definition: Player.hpp:35