aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorClyne Sullivan <clyne@bitgloo.com>2019-09-02 18:53:21 -0400
committerClyne Sullivan <clyne@bitgloo.com>2019-09-02 18:53:21 -0400
commitaa7b0a92d065b4435467d482ec65dd97b03459ee (patch)
tree0b1c4406f4fbeea6fee2e73eaf735386c5cc1ab6 /src
parent6614ea639414caab546091841bf920fe6459cc9e (diff)
made json names readable
Diffstat (limited to 'src')
-rw-r--r--src/components/Light.hpp8
-rw-r--r--src/components/Name.hpp8
-rw-r--r--src/components/Player.hpp4
-rw-r--r--src/components/Position.hpp8
-rw-r--r--src/components/Render.hpp8
-rw-r--r--src/components/Script.hpp4
-rw-r--r--src/components/Velocity.hpp8
-rw-r--r--src/engine.cpp1
8 files changed, 39 insertions, 10 deletions
diff --git a/src/components/Light.hpp b/src/components/Light.hpp
index 2cb0e1b..6849d7c 100644
--- a/src/components/Light.hpp
+++ b/src/components/Light.hpp
@@ -51,11 +51,15 @@ public:
}
void serialize(cereal::JSONOutputArchive& ar) final {
- ar(r, g, b, strength);
+ ar(CEREAL_NVP(r), CEREAL_NVP(g), CEREAL_NVP(b), CEREAL_NVP(strength));
}
void serialize(cereal::JSONInputArchive& ar) final {
- ar(r, g, b, strength);
+ ar(CEREAL_NVP(r), CEREAL_NVP(g), CEREAL_NVP(b), CEREAL_NVP(strength));
+ }
+
+ std::string serializeName(void) const final {
+ return "Light";
}
};
diff --git a/src/components/Name.hpp b/src/components/Name.hpp
index b42ef46..a6a6d8a 100644
--- a/src/components/Name.hpp
+++ b/src/components/Name.hpp
@@ -40,11 +40,15 @@ public:
}
void serialize(cereal::JSONOutputArchive& ar) final {
- ar(name);
+ ar(CEREAL_NVP(name));
}
void serialize(cereal::JSONInputArchive& ar) final {
- ar(name);
+ ar(CEREAL_NVP(name));
+ }
+
+ std::string serializeName(void) const final {
+ return "Name";
}
};
diff --git a/src/components/Player.hpp b/src/components/Player.hpp
index 95b2a96..33db1eb 100644
--- a/src/components/Player.hpp
+++ b/src/components/Player.hpp
@@ -35,6 +35,10 @@ public:
void serialize([[maybe_unused]] cereal::JSONOutputArchive& ar) final {}
void serialize([[maybe_unused]] cereal::JSONInputArchive& ar) final {}
+
+ std::string serializeName(void) const final {
+ return "Player";
+ }
};
#endif // COMPONENT_PLAYER_HPP_
diff --git a/src/components/Position.hpp b/src/components/Position.hpp
index 6157265..56e8707 100644
--- a/src/components/Position.hpp
+++ b/src/components/Position.hpp
@@ -44,11 +44,15 @@ public:
}
void serialize(cereal::JSONOutputArchive& ar) final {
- ar(x, y);
+ ar(CEREAL_NVP(x), CEREAL_NVP(y));
}
void serialize(cereal::JSONInputArchive& ar) final {
- ar(x, y);
+ ar(CEREAL_NVP(x), CEREAL_NVP(y));
+ }
+
+ std::string serializeName(void) const final {
+ return "Position";
}
};
diff --git a/src/components/Render.hpp b/src/components/Render.hpp
index 49a9588..81ca591 100644
--- a/src/components/Render.hpp
+++ b/src/components/Render.hpp
@@ -55,11 +55,15 @@ public:
}
void serialize(cereal::JSONOutputArchive& ar) final {
- ar(visible, flipX);
+ ar(CEREAL_NVP(visible), CEREAL_NVP(flipX));
}
void serialize(cereal::JSONInputArchive& ar) final {
- ar(visible, flipX);
+ ar(CEREAL_NVP(visible), CEREAL_NVP(flipX));
+ }
+
+ std::string serializeName(void) const final {
+ return "Render";
}
};
diff --git a/src/components/Script.hpp b/src/components/Script.hpp
index 178c933..f792750 100644
--- a/src/components/Script.hpp
+++ b/src/components/Script.hpp
@@ -63,6 +63,10 @@ public:
void serialize([[maybe_unused]] cereal::JSONOutputArchive& ar) final {}
void serialize([[maybe_unused]] cereal::JSONInputArchive& ar) final {}
+
+ std::string serializeName(void) const final {
+ return "Scripted";
+ }
};
#endif // COMPONENT_SCRIPT_HPP_
diff --git a/src/components/Velocity.hpp b/src/components/Velocity.hpp
index 7a75706..776c1dd 100644
--- a/src/components/Velocity.hpp
+++ b/src/components/Velocity.hpp
@@ -45,11 +45,15 @@ public:
}
void serialize(cereal::JSONOutputArchive& ar) final {
- ar(x, y);
+ ar(CEREAL_NVP(x), CEREAL_NVP(y));
}
void serialize(cereal::JSONInputArchive& ar) final {
- ar(x, y);
+ ar(CEREAL_NVP(x), CEREAL_NVP(y));
+ }
+
+ std::string serializeName(void) const final {
+ return "Velocity";
}
};
diff --git a/src/engine.cpp b/src/engine.cpp
index db31b9d..539515c 100644
--- a/src/engine.cpp
+++ b/src/engine.cpp
@@ -126,6 +126,7 @@ void Engine::run(void)
entities.entity_serialize(e, true, archive);
archive.finishNode();
}
+ std::cout << std::endl;
}
bool Engine::shouldRun(void)