28 const std::map<int, SkillInfo>&
getSkills();
Contains all the skills that a character has.
Definition: SkillSet.hpp:20
bool addSkillXp(int id, unsigned int amount)
Adds the given amount of xp to the skill with the given id. Returns false if the addition failed,...
Definition: SkillSet.cpp:42
const std::map< int, SkillInfo > & getSkills()
Returns map with skill id keys and SkillInfo values.
Definition: SkillSet.cpp:18
std::optional< int > getSkillLevel(int id)
Returns the level of the skill calculated based on the current xp in the skill. Returns nullopt if th...
Definition: SkillSet.cpp:23
std::optional< int > getSkillXp(int id)
Returns the current xp of the skill with the given id. Returns nullopt if the skill doesn't exist.
Definition: SkillSet.cpp:32
SkillSet()
Definition: SkillSet.cpp:6
std::map< int, SkillInfo > skillsM
Key = skill id, Value = SkillInfo.
Definition: SkillSet.hpp:53
Each player has a set of skills. This struct contains the name of the skill and the current xp in the...
Definition: SkillSet.hpp:11
const std::string name
Definition: SkillSet.hpp:12
int xp
Definition: SkillSet.hpp:13