aboutsummaryrefslogtreecommitdiffstats
path: root/src/engine.cpp
diff options
context:
space:
mode:
authorClyne Sullivan <clyne@bitgloo.com>2019-09-02 18:23:09 -0400
committerClyne Sullivan <clyne@bitgloo.com>2019-09-02 18:23:09 -0400
commit6614ea639414caab546091841bf920fe6459cc9e (patch)
tree408df7aeb419ed6e096512d371f499ac6732cade /src/engine.cpp
parent0466537f81106f679c0b291be26861862c43c13c (diff)
json entity saving: cout
Diffstat (limited to 'src/engine.cpp')
-rw-r--r--src/engine.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/engine.cpp b/src/engine.cpp
index 61d119a..db31b9d 100644
--- a/src/engine.cpp
+++ b/src/engine.cpp
@@ -116,6 +116,16 @@ void Engine::run(void)
// Done, bring logic thread back
logicThread.join();
+
+ cereal::JSONOutputArchive archive (std::cout);
+ std::string name ("entity");
+ int i = 0;
+ for (entityx::Entity e : entities.entities_for_debugging()) {
+ archive.setNextName((name + std::to_string(i++)).c_str());
+ archive.startNode();
+ entities.entity_serialize(e, true, archive);
+ archive.finishNode();
+ }
}
bool Engine::shouldRun(void)