reworked JLoader as JSON_Loader, will require rework of rest of obj model
This commit is contained in:
@@ -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.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user