Deserializer.
This commit is contained in:
parent
4f1075dc28
commit
8117dc357f
@ -55,6 +55,19 @@ namespace character {
|
|||||||
[[nodiscard]] std::uint32_t get_glory() const { return glory; }
|
[[nodiscard]] std::uint32_t get_glory() const { return glory; }
|
||||||
|
|
||||||
[[nodiscard]] std::uint32_t get_money() const { return money; }
|
[[nodiscard]] std::uint32_t get_money() const { return money; }
|
||||||
|
|
||||||
|
friend void from_json(const json &j, CharacterSheet &billy) {
|
||||||
|
j.at("caracters").get_to(billy.caractere);
|
||||||
|
j.at("adresse").get_to(billy.adresse);
|
||||||
|
j.at("endurance").get_to(billy.endurance);
|
||||||
|
j.at("chance").get_to(billy.chance);
|
||||||
|
j.at("habilete").get_to(billy.habilete);
|
||||||
|
j.at("health_point").get_to(billy.health_point);
|
||||||
|
j.at("armor").get_to(billy.armor);
|
||||||
|
j.at("damage").get_to(billy.damage);
|
||||||
|
j.at("glory").get_to(billy.glory);
|
||||||
|
j.at("money").get_to(billy.money);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
void to_json(json &j, const CharacterSheet &billy) {
|
void to_json(json &j, const CharacterSheet &billy) {
|
||||||
|
Loading…
Reference in New Issue
Block a user