diff options
author | clyne <clyne@bitgloo.com> | 2019-09-03 18:17:51 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-03 18:17:51 -0400 |
commit | ec1d57aeadbd0f34616eeec8f1a922ca61b90085 (patch) | |
tree | 9d2233f2437b8e85d151f9610b1a147310b9c13e /src/components/Light.hpp | |
parent | 0b3d24c4295bb89eb4ce3f91163cabd64d0ca6e2 (diff) | |
parent | 95cc88ad5f6c2abb4890d00a57ae4ad0db030e9b (diff) |
Merge pull request #1 from tcsullivan/save-load
Save load looks good
Diffstat (limited to 'src/components/Light.hpp')
-rw-r--r-- | src/components/Light.hpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/components/Light.hpp b/src/components/Light.hpp index ee215a6..6849d7c 100644 --- a/src/components/Light.hpp +++ b/src/components/Light.hpp @@ -22,7 +22,7 @@ #include "Component.hpp" -struct Light : Component<Light>, entityx::Component<Light> +struct Light : Component<Light> { public: float r, g, b; @@ -49,6 +49,18 @@ public: } return *this; } + + void serialize(cereal::JSONOutputArchive& ar) final { + ar(CEREAL_NVP(r), CEREAL_NVP(g), CEREAL_NVP(b), CEREAL_NVP(strength)); + } + + void serialize(cereal::JSONInputArchive& ar) final { + ar(CEREAL_NVP(r), CEREAL_NVP(g), CEREAL_NVP(b), CEREAL_NVP(strength)); + } + + std::string serializeName(void) const final { + return "Light"; + } }; #endif//COMPONENT_LIGHT_HPP_ |