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:
53
src/loaders/Unit.cpp
Normal file
53
src/loaders/Unit.cpp
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user