|
Rehti MMORPG
1.0.0
Rehti MMORPG is a free and open source MMORPG game.
|
Contains all the skills that a character has. More...
#include <SkillSet.hpp>

Public Member Functions | |
| SkillSet () | |
| const std::map< int, SkillInfo > & | getSkills () |
| Returns map with skill id keys and SkillInfo values. More... | |
| 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. More... | |
| std::optional< int > | getSkillLevel (int id) |
| Returns the level of the skill calculated based on the current xp in the skill. Returns nullopt if the skill doesn't exist. More... | |
| 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, for example skill doesn't exist. More... | |
Private Attributes | |
| std::map< int, SkillInfo > | skillsM |
| Key = skill id, Value = SkillInfo. More... | |
Contains all the skills that a character has.
| SkillSet::SkillSet | ( | ) |

| bool SkillSet::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, for example skill doesn't exist.
| id | |
| amount |

| std::optional< int > SkillSet::getSkillLevel | ( | int | id | ) |
Returns the level of the skill calculated based on the current xp in the skill. Returns nullopt if the skill doesn't exist.
| id |


| const std::map< int, SkillInfo > & SkillSet::getSkills | ( | ) |
Returns map with skill id keys and SkillInfo values.

| std::optional< int > SkillSet::getSkillXp | ( | int | id | ) |
Returns the current xp of the skill with the given id. Returns nullopt if the skill doesn't exist.
| id |
