1 #ifndef ATTRIBUTE_MANAGER_H
2 #define ATTRIBUTE_MANAGER_H
4 #include <unordered_map>
6 #include "../../include/nlohmann/json.hpp"
7 #include "../../include/types.h"
12 uint32_t intelligence;
16 inline void to_json(nlohmann::json &j,
const stats_t &s) {
17 j[
"strength"] = s.strength;
18 j[
"agility"] = s.agility;
19 j[
"intelligence"] = s.intelligence;
20 j[
"physique"] = s.physique;
23 inline void from_json(
const nlohmann::json &j,
stats_t &s) {
24 j[
"strength"].get_to(s.strength);
25 j[
"agility"].get_to(s.agility);
26 j[
"intelligence"].get_to(s.intelligence);
27 j[
"physique"].get_to(s.physique);
33 static std::unordered_map<race_type_t, std::string> race_names_map;
34 static std::unordered_map<race_type_t, nlohmann::json> race_modif_map;
35 static std::unordered_map<race_type_t, nlohmann::json> race_multi_map;
37 static std::unordered_map<class_type_t, std::string> class_names_map;
38 static std::unordered_map<class_type_t, nlohmann::json> class_multi_map;
39 static bool race_exists(race_type_t race_type);
40 static bool class_exists(class_type_t class_type);
55 static void init(
const char *stats_file,
const char *races_file,
56 const char *classes_file);
66 static std::string get_race_name(race_type_t race_type);
67 static float get_race_hp_multiplier(race_type_t race_type);
68 static float get_race_mp_multiplier(race_type_t race_type);
69 static float get_regen_multiplier(race_type_t race_type);
72 static std::string get_class_name(class_type_t class_type);
73 static float get_class_hp_multiplier(class_type_t class_type);
74 static float get_class_mp_multiplier(class_type_t class_type);
75 static float get_meditate_multiplier(class_type_t class_type);
78 #endif // ATTRIBUTE_MANAGER_H