From 4f1075dc2870ce4c7e26caaf3a94d670fc6a85af Mon Sep 17 00:00:00 2001 From: Pcornat Date: Fri, 14 Jan 2022 23:09:20 +0100 Subject: [PATCH] Serializer. --- include/character_sheet.hpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/include/character_sheet.hpp b/include/character_sheet.hpp index 7f1d735..f5fbe72 100644 --- a/include/character_sheet.hpp +++ b/include/character_sheet.hpp @@ -56,6 +56,19 @@ namespace character { [[nodiscard]] std::uint32_t get_money() const { return money; } }; + + void to_json(json &j, const CharacterSheet &billy) { + j["caractere"] = billy.get_caractere(); + j["adresse"] = billy.get_adresse(); + j["endurance"] = billy.get_endurance(); + j["chance"] = billy.get_chance(); + j["habilete"] = billy.get_habilete(); + j["health_point"] = billy.get_health_point(); + j["armor"] = billy.get_armor(); + j["damage"] = billy.get_damage(); + j["glory"] = billy.get_glory(); + j["money"] = billy.get_money(); + } }