Peoplemon  0.1.0
Peoplemon 3 game source documentation
Animation.hpp
Go to the documentation of this file.
1 #ifndef GAME_BATTLES_COMMANDS_ANIMATION_HPP
2 #define GAME_BATTLES_COMMANDS_ANIMATION_HPP
3 
4 #include <Core/Items/Id.hpp>
9 #include <cstdint>
10 #include <variant>
11 
12 namespace core
13 {
14 namespace battle
15 {
17 namespace cmd
18 {
25 struct Animation {
30  enum struct Type : std::uint8_t {
31  _ERROR = 0,
32  ShakeAndFlash = 1,
33  SlideDown,
34  ComeBack,
35  SendOut,
36  UseMove,
43  SlideOut,
44  Ailment,
51  };
52 
58  Animation(Type type);
59 
66  Animation(bool forHost, Type type);
67 
74  Animation(bool forHost, core::pplmn::MoveId move);
75 
83  Animation(bool forHost, Type type, pplmn::Stat stat);
84 
91  Animation(bool forHost, pplmn::Ailment ailment);
92 
99  Animation(bool forHost, pplmn::PassiveAilment ailment);
100 
108  Animation(bool forHost, Type type, item::Id peopleball);
109 
114  bool forHostBattler() const;
115 
120  Type getType() const;
121 
126  pplmn::MoveId getMove() const;
127 
132  pplmn::Stat getStat() const;
133 
138  pplmn::Ailment getAilment() const;
139 
145 
150  item::Id getPeopleball() const;
151 
152 private:
153  struct Empty {};
154 
155  bool forHost;
156  Type type;
158  item::Id>
159  data;
160 };
161 
162 } // namespace cmd
163 } // namespace battle
164 } // namespace core
165 
166 #endif
Id
Represents an item in its simplist form.
Definition: Id.hpp:24
PassiveAilment
Represents a passive ailment a Peoplemon can have.
Stat
Represents a single stat. Used as an offset to access Stats as an array.
Definition: Stat.hpp:16
Ailment
Represents an ailment that a Peoplemon can have.
Definition: Ailment.hpp:16
MoveId
The id of a move.
Definition: MoveId.hpp:16
Core classes and functionality for both the editor and game.
Represents a type of animation that can be played in battle.
Definition: Animation.hpp:25
pplmn::MoveId getMove() const
Returns the move for this animation.
Definition: Animation.cpp:48
Type
The type of animation to play.
Definition: Animation.hpp:30
bool forHostBattler() const
Returns whether or not this animation is for the host or not.
Definition: Animation.cpp:44
pplmn::PassiveAilment getPassiveAilment() const
Get the ailment for this animation.
Definition: Animation.cpp:63
Type getType() const
Returns the type of animation to play.
Definition: Animation.cpp:46
pplmn::Ailment getAilment() const
Get the ailment for this animation.
Definition: Animation.cpp:58
pplmn::Stat getStat() const
Returns the stat for this animation.
Definition: Animation.cpp:53
item::Id getPeopleball() const
Get the Peopleball for this animation.
Definition: Animation.cpp:68
Animation(Type type)
For animations that are not specific to either battler.
Definition: Animation.cpp:9