aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/Position.hpp
diff options
context:
space:
mode:
authorclyne <clyne@bitgloo.com>2019-09-03 18:17:51 -0400
committerGitHub <noreply@github.com>2019-09-03 18:17:51 -0400
commitec1d57aeadbd0f34616eeec8f1a922ca61b90085 (patch)
tree9d2233f2437b8e85d151f9610b1a147310b9c13e /src/components/Position.hpp
parent0b3d24c4295bb89eb4ce3f91163cabd64d0ca6e2 (diff)
parent95cc88ad5f6c2abb4890d00a57ae4ad0db030e9b (diff)
Merge pull request #1 from tcsullivan/save-load
Save load looks good
Diffstat (limited to 'src/components/Position.hpp')
-rw-r--r--src/components/Position.hpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/components/Position.hpp b/src/components/Position.hpp
index c801998..56e8707 100644
--- a/src/components/Position.hpp
+++ b/src/components/Position.hpp
@@ -21,7 +21,7 @@
#include "Component.hpp"
-struct Position : Component<Position>, entityx::Component<Position>
+struct Position : Component<Position>
{
public:
double x, y;
@@ -42,6 +42,18 @@ public:
}
return *this;
}
+
+ void serialize(cereal::JSONOutputArchive& ar) final {
+ ar(CEREAL_NVP(x), CEREAL_NVP(y));
+ }
+
+ void serialize(cereal::JSONInputArchive& ar) final {
+ ar(CEREAL_NVP(x), CEREAL_NVP(y));
+ }
+
+ std::string serializeName(void) const final {
+ return "Position";
+ }
};
#endif // COMPONENT_POSITION_HPP_