Peoplemon  0.1.0
Peoplemon 3 game source documentation
Peoplemon.hpp
Go to the documentation of this file.
1 #ifndef CORE_PEOPLEMON_PEOPLEMON_HPP
2 #define CORE_PEOPLEMON_PEOPLEMON_HPP
3 
4 #include <string>
5 #include <unordered_map>
6 #include <unordered_set>
7 #include <vector>
8 
11 #include <Core/Peoplemon/Id.hpp>
14 #include <Core/Peoplemon/Stats.hpp>
15 #include <Core/Peoplemon/Type.hpp>
16 
24 namespace core
25 {
27 namespace pplmn
28 {
35 class Peoplemon {
36 public:
42  static void setDataSource(file::PeoplemonDB& data);
43 
50  static Id cast(unsigned int id);
51 
57  static const std::vector<Id>& validIds();
58 
65  static const std::string& name(Id id);
66 
73  static const std::string& description(Id id);
74 
81  static Type type(Id id);
82 
89  static SpecialAbility specialAbility(Id id);
90 
97  static const Stats& baseStats(Id id);
98 
106  static bool canLearnMove(Id ppl, MoveId move);
107 
115  static MoveId moveLearnedAtLevel(Id ppl, unsigned int level);
116 
123  static unsigned int evolveLevel(Id id);
124 
131  static Id evolvesInto(Id orig);
132 
139  static Id evolvesFrom(Id evolved);
140 
147  static const Stats& evAward(Id id);
148 
156  static int xpYieldMultiplier(Id id);
157 
165  static unsigned int levelUpXp(Id id, unsigned int level);
166 
173  static std::string thumbnailImage(Id id);
174 
181  static std::string playerImage(Id id);
182 
189  static std::string opponentImage(Id id);
190 
197  static float catchRate(Id id);
198 
205  static bool canClone(Id id);
206 
213  static std::string ailmentString(Ailment ailment);
214 
221  static const std::string& abilityName(SpecialAbility ability);
222 
229  static const std::string& abilityDescription(SpecialAbility ability);
230 
231 private:
232  static std::unordered_map<Id, std::string>* names;
233  static std::unordered_map<Id, std::string>* descriptions;
234  static std::unordered_map<Id, Type>* types;
235  static std::unordered_map<Id, SpecialAbility>* abilities;
236  static std::unordered_map<Id, Stats>* stats;
237  static std::unordered_map<Id, std::unordered_set<MoveId>>* validMoves;
238  static std::unordered_map<Id, std::unordered_map<unsigned int, MoveId>>* learnedMoves;
239  static std::unordered_map<Id, unsigned int>* evolveLevels;
240  static std::unordered_map<Id, Id>* evolveIds;
241  static std::unordered_map<Id, Stats>* evAwards;
242  static std::unordered_map<Id, unsigned int>* xpGroups;
243  static std::unordered_map<Id, int>* xpMults;
244  static std::unordered_map<Id, int>* catchRates;
245 };
246 
247 } // namespace pplmn
248 } // namespace core
249 
250 #endif
Ailment
Represents an ailment that a Peoplemon can have.
Definition: Ailment.hpp:16
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
SpecialAbility
Represents a special ability that a Peoplemon may have.
Id
The id of a peoplemon.
Definition: Id.hpp:16
Core classes and functionality for both the editor and game.
Data structure that holds the underlaying data for all the peoplemon.
Definition: PeoplemonDB.hpp:26
Serves as the primary store of all Peoplemon information.
Definition: Peoplemon.hpp:35
static bool canClone(Id id)
Returns whether or not the given Peoplemon may be cloned.
Definition: Peoplemon.cpp:242
static unsigned int evolveLevel(Id id)
Returns the minimum level that the given peoplemon will evolve at.
Definition: Peoplemon.cpp:166
static std::string playerImage(Id id)
Returns the full path to the image to use in battle for the player peoplemon.
Definition: Peoplemon.cpp:219
static void setDataSource(file::PeoplemonDB &data)
Sets the data source for all peoplemon. Must remain in scope.
Definition: Peoplemon.cpp:94
static MoveId moveLearnedAtLevel(Id ppl, unsigned int level)
Returns the move the peoplemon learns at the given level, if any.
Definition: Peoplemon.cpp:157
static float catchRate(Id id)
Returns the base catch rate for the given peoplemon.
Definition: Peoplemon.cpp:237
static SpecialAbility specialAbility(Id id)
Returns the ability of the given peoplemon, if any.
Definition: Peoplemon.cpp:141
static std::string opponentImage(Id id)
Returns the full path to the image to use in battle for the opponent peoplemon.
Definition: Peoplemon.cpp:228
static int xpYieldMultiplier(Id id)
Returns the multiplier used when computing the XP award for defeating the given peoplemon.
Definition: Peoplemon.cpp:182
static const std::string & abilityDescription(SpecialAbility ability)
Returns the description of the given special ability.
Definition: Peoplemon.cpp:268
static Id evolvesInto(Id orig)
Returns what the given peoplemon will evolve into.
Definition: Peoplemon.cpp:171
static Id evolvesFrom(Id evolved)
Returns what the given Peoplemon evolved from. This is expensive.
Definition: Peoplemon.cpp:204
static const std::string & description(Id id)
Returns the description of the given Peoplemon.
Definition: Peoplemon.cpp:131
static bool canLearnMove(Id ppl, MoveId move)
Returns whether or not the given Peoplemon can learn the given move.
Definition: Peoplemon.cpp:152
static std::string ailmentString(Ailment ailment)
Returns the name of the given ailment as a string.
Definition: Peoplemon.cpp:244
static unsigned int levelUpXp(Id id, unsigned int level)
Returns the XP required to level up the given peoplemon.
Definition: Peoplemon.cpp:187
static const std::vector< Id > & validIds()
Returtns the list of all valid ids.
Definition: Peoplemon.cpp:118
static const Stats & baseStats(Id id)
Returns the base stats for the given peoplemon.
Definition: Peoplemon.cpp:146
static const std::string & name(Id id)
Returns the name of the given Peoplemon.
Definition: Peoplemon.cpp:126
static const Stats & evAward(Id id)
Returns the ev points awarded for defeating the given peoplemon.
Definition: Peoplemon.cpp:176
static Type type(Id id)
Returns the type of the Peoplemon.
Definition: Peoplemon.cpp:136
static const std::string & abilityName(SpecialAbility ability)
Returns the name of the given special ability.
Definition: Peoplemon.cpp:263
static Id cast(unsigned int id)
Casts an integer to a validated id. Returns Unknown if the id is invalid.
Definition: Peoplemon.cpp:112
static std::string thumbnailImage(Id id)
Returns the path of the image to render as the peoplemon thumbnail.
Definition: Peoplemon.cpp:211
Stats for Peoplemon. This struct is used for base stats, EVs, IVs, battle increases/decreases,...
Definition: Stats.hpp:19