Skip to content

Commit

Permalink
test serialize member
Browse files Browse the repository at this point in the history
  • Loading branch information
Ubpa committed Jul 29, 2020
1 parent 1c71e3f commit cc55802
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/test/14_serialize/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,18 @@ class Dumper : public IListener {
indent++;
PrintIndent();
cout << "\"type\" : \"" << RTDCmptTraits::Instance().Nameof(cmpt->Type()) << "\"";
if (cmpt->Type().Is<Velocity>()) {
auto v = cmpt->As<Velocity>();
cout << "," << endl;
PrintIndent();
cout << "\"val\" : " << v->val;
}
else if (cmpt->Type().Is<Position>()) {
auto p = cmpt->As<Position>();
cout << "," << endl;
PrintIndent();
cout << "\"val\" : " << p->val;
}
}

virtual void ExistCmptPtr(const CmptPtr* cmpt) override {
Expand Down

0 comments on commit cc55802

Please sign in to comment.