broke classes down into own files, preparing to change model to pass by reference with int return type for almost everything

This commit is contained in:
Chris Punches
2017-04-30 01:39:03 -04:00
parent 8a53aefd48
commit 245ee4323a
33 changed files with 648 additions and 326 deletions

53
src/loaders/Unit.cpp Normal file
View File

@@ -0,0 +1,53 @@
#include "Unit.h"
Unit::Unit( Json::Value loader_root )
/*
* Constructor for Unit type. Receives a UnitHolder loader_root.
*/
{
this->name = loader_root.get("name", "?").asString();
this->target = loader_root.get("target", "?").asString();
this->output = loader_root.get("output", "?").asString();
this->rectifier = loader_root.get("rectifier", "?").asString();
this->active = loader_root.get("active", "?").asString();
this->required = loader_root.get("required", "?").asString();
this->rectify = loader_root.get("rectify", "?").asString();
}
/*
* getters for Unit type.
*/
std::string Unit::get_name()
{
return this->name;
}
std::string Unit::get_target()
{
return this->target;
}
std::string Unit::get_output()
{
return this->output;
}
std::string Unit::get_rectifier()
{
return this->rectifier;
}
std::string Unit::get_active()
{
return this->active;
}
std::string Unit::get_required()
{
return this->required;
}
std::string Unit::get_rectify()
{
return this->rectify;
}