Serialize and deserialize.
This commit is contained in:
parent
e762ab05c6
commit
7b6eca1067
6 changed files with 96 additions and 60 deletions
|
@ -2,20 +2,23 @@
|
|||
#define BILLYSHEET_HABILETE_HPP
|
||||
|
||||
#include <cstdint>
|
||||
#include "characteristic.hpp"
|
||||
|
||||
namespace character::characteristic {
|
||||
class Habilete final {
|
||||
private:
|
||||
const std::uint32_t base{ 2 };
|
||||
std::uint32_t carac{ 0 };
|
||||
std::uint32_t materiel{ 0 };
|
||||
std::uint32_t additional{ 0 };
|
||||
|
||||
class Habilete final : public Characteristic {
|
||||
public:
|
||||
Habilete() noexcept = default;
|
||||
Habilete() noexcept: Characteristic(2, 0, 0, 0) {};
|
||||
|
||||
~Habilete() noexcept = default;
|
||||
~Habilete() noexcept final = default;
|
||||
|
||||
friend void from_json(const json &j, Habilete &habilete) {
|
||||
nlohmann::from_json(j, static_cast<Characteristic &>(habilete));
|
||||
}
|
||||
};
|
||||
|
||||
void to_json(json &j, const Habilete &habilete) {
|
||||
to_json(j, static_cast<Characteristic>(habilete));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue