reworked JLoader as JSON_Loader, will require rework of rest of obj model

This commit is contained in:
Chris Punches
2017-06-08 23:49:13 -04:00
parent 245ee4323a
commit 9fe2d4923a
37 changed files with 854 additions and 1034 deletions

View File

@@ -1,9 +1,16 @@
#include "Unit.h"
Unit::Unit() {}
Unit::Unit( Json::Value loader_root )
/*
* Constructor for Unit type. Receives a UnitHolder loader_root.
*/
{
this->load_root( loader_root );
}
int Unit::load_root(Json::Value loader_root)
{
this->name = loader_root.get("name", "?").asString();
this->target = loader_root.get("target", "?").asString();
@@ -12,8 +19,9 @@ Unit::Unit( Json::Value loader_root )
this->active = loader_root.get("active", "?").asString();
this->required = loader_root.get("required", "?").asString();
this->rectify = loader_root.get("rectify", "?").asString();
}
return EXIT_SUCCESS;
}
/*
* getters for Unit type.
*/