Peoplemon  0.1.0
Peoplemon 3 game source documentation
Animation.cpp
Go to the documentation of this file.
2 
3 namespace core
4 {
5 namespace battle
6 {
7 namespace cmd
8 {
10 : forHost(true)
11 , type(tp)
12 , data(Empty()) {}
13 
15 : forHost(fa)
16 , type(tp)
17 , data(Empty()) {}
18 
20 : forHost(fa)
21 , type(Type::UseMove)
22 , data(m) {}
23 
25 : forHost(fa)
26 , type(tp)
27 , data(stat) {}
28 
30 : forHost(fa)
31 , type(Type::Ailment)
32 , data(ail) {}
33 
35 : forHost(fa)
36 , type(Type::PassiveAilment)
37 , data(ail) {}
38 
40 : forHost(fa)
41 , type(tp)
42 , data(pb) {}
43 
44 bool Animation::forHostBattler() const { return forHost; }
45 
46 Animation::Type Animation::getType() const { return type; }
47 
49  const pplmn::MoveId* m = std::get_if<pplmn::MoveId>(&data);
50  return m ? *m : pplmn::MoveId::Unknown;
51 }
52 
54  const pplmn::Stat* s = std::get_if<pplmn::Stat>(&data);
55  return s ? *s : pplmn::Stat::Attack;
56 }
57 
59  const pplmn::Ailment* a = std::get_if<pplmn::Ailment>(&data);
60  return a ? *a : pplmn::Ailment::Annoyed;
61 }
62 
64  const pplmn::PassiveAilment* a = std::get_if<pplmn::PassiveAilment>(&data);
65  return a ? *a : pplmn::PassiveAilment::Confused;
66 }
67 
69  const item::Id* i = std::get_if<item::Id>(&data);
70  return i ? *i : item::Id::Peopleball;
71 }
72 
73 } // namespace cmd
74 } // namespace battle
75 } // namespace core
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.
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