Peoplemon  0.1.0
Peoplemon 3 game source documentation
Move.hpp
Go to the documentation of this file.
1 #ifndef CORE_PEOPLEMON_MOVE_HPP
2 #define CORE_PEOPLEMON_MOVE_HPP
3 
4 #include <unordered_map>
5 
6 #include <Core/Files/MoveDB.hpp>
10 
11 namespace core
12 {
13 namespace pplmn
14 {
21 class Move {
22 public:
29  static MoveId cast(unsigned int id);
30 
36  static const std::vector<MoveId>& validIds();
37 
43  static void setDataSource(file::MoveDB& source);
44 
49  static const std::string& name(MoveId move);
50 
55  static const std::string& description(MoveId move);
56 
61  static Type type(MoveId move);
62 
67  static int damage(MoveId move);
68 
73  static int accuracy(MoveId move);
74 
79  static int priority(MoveId move);
80 
85  static unsigned int pp(MoveId move);
86 
91  static bool makesContact(MoveId move);
92 
97  static bool isSpecial(MoveId move);
98 
103  static MoveEffect effect(MoveId move);
104 
109  static int effectChance(MoveId move);
110 
115  static int effectIntensity(MoveId move);
116 
121  static bool affectsUser(MoveId move);
122 
129  static std::string playerAnimationBackground(MoveId move);
130 
137  static std::string playerAnimationForeground(MoveId move);
138 
145  static std::string opponentAnimationBackground(MoveId move);
146 
153  static std::string opponentAnimationForeground(MoveId move);
154 
161  static MoveId getRandomMove(bool allowRandomEffect = false);
162 
163 private:
164  static std::unordered_map<MoveId, std::string>* names;
165  static std::unordered_map<MoveId, std::string>* descriptions;
166  static std::unordered_map<MoveId, std::string>* animationPaths;
167  static std::unordered_map<MoveId, Type>* types;
168  static std::unordered_map<MoveId, int>* damages;
169  static std::unordered_map<MoveId, int>* accuracies;
170  static std::unordered_map<MoveId, int>* priorities;
171  static std::unordered_map<MoveId, unsigned int>* pps;
172  static std::unordered_map<MoveId, bool>* contactors;
173  static std::unordered_map<MoveId, bool>* specials;
174  static std::unordered_map<MoveId, MoveEffect>* effects;
175  static std::unordered_map<MoveId, int>* effectChances;
176  static std::unordered_map<MoveId, int>* effectIntensities;
177  static std::unordered_map<MoveId, bool>* effectSelves;
178 };
179 
180 } // namespace pplmn
181 } // namespace core
182 
183 #endif
Type
Represents a type that a move or Peoplemon can be. Types may be combined.
Definition: Type.hpp:18
MoveId
The id of a move.
Definition: MoveId.hpp:16
MoveEffect
Represents an effect that a move can have. Copied verbatim from Peoplemon 2, may refactor later when ...
Definition: MoveEffect.hpp:17
Core classes and functionality for both the editor and game.
Stores the metadata of all peoplemon moves.
Definition: MoveDB.hpp:22
Encapsulates the move datastore.
Definition: Move.hpp:21
static unsigned int pp(MoveId move)
Returns the max pp of the given move.
Definition: Move.cpp:101
static int damage(MoveId move)
Returns the damage of the given move.
Definition: Move.cpp:86
static const std::string & description(MoveId move)
Returns the description of the given move.
Definition: Move.cpp:76
static int accuracy(MoveId move)
Returns the accuracy of the given move.
Definition: Move.cpp:91
static std::string playerAnimationBackground(MoveId move)
Returns the path to the animation for when the local player uses the move.
Definition: Move.cpp:136
static const std::vector< MoveId > & validIds()
Returns the list of all valid move ids.
Definition: Move.cpp:64
static int priority(MoveId move)
Returns the priority of the given move.
Definition: Move.cpp:96
static bool makesContact(MoveId move)
Returns whether or not the given move makes physical contact when used.
Definition: Move.cpp:106
static int effectIntensity(MoveId move)
Returns the effect intensity of the given move.
Definition: Move.cpp:126
static std::string playerAnimationForeground(MoveId move)
Returns the path to the animation for when the local player uses the move.
Definition: Move.cpp:142
static void setDataSource(file::MoveDB &source)
Set the data source for each method.
Definition: Move.cpp:46
static MoveEffect effect(MoveId move)
Returns the effect of the given move.
Definition: Move.cpp:116
static MoveId getRandomMove(bool allowRandomEffect=false)
Returns a random, valid move. Optionally filters moves that have the Random effect.
Definition: Move.cpp:160
static const std::string & name(MoveId move)
Returns the name of the given move.
Definition: Move.cpp:71
static Type type(MoveId move)
Returns the type of the given move.
Definition: Move.cpp:81
static int effectChance(MoveId move)
Returns the effect chance of the given move.
Definition: Move.cpp:121
static bool isSpecial(MoveId move)
Returns whether or not the given move is special.
Definition: Move.cpp:111
static std::string opponentAnimationForeground(MoveId move)
Returns the path to the animation for when the opponent uses the move.
Definition: Move.cpp:154
static std::string opponentAnimationBackground(MoveId move)
Returns the path to the animation for when the opponent uses the move.
Definition: Move.cpp:148
static MoveId cast(unsigned int id)
Converts the given raw id to a move id, or Unknown if invalid.
Definition: Move.cpp:37
static bool affectsUser(MoveId move)
Returns whether or not the given move affects the user or the opponent.
Definition: Move.cpp:131