cleaned up what should be private member access

This commit is contained in:
Chris Punches
2017-04-29 17:35:03 -04:00
parent 69539ae019
commit d62df8b076
12 changed files with 479 additions and 240 deletions

View File

@@ -4,22 +4,38 @@
int main()
{
// A Plan is made up of Tasks, and a Suite is made up of Units.
// A Plan declares what units are executed and a Suite declares the definitions of those units.
Conf configuration = Conf("config.json");
UnitHolder unitHolder = UnitHolder( configuration.get_units_path() );
Plan plan = Plan( configuration.get_plan_path() );
// load the configuration file which contains filepaths to definitions of a plan and definitions of units.
std::string definitions_file = configuration.get_units_path();
std::string plan_file = configuration.get_plan_path();
for ( int i = 0; i < plan.tasks.size(); ++i )
Suite unit_definitions = Suite( definitions_file );
Plan plan = Plan( plan_file );
for ( int i = 0; i < plan.num_tasks(); ++i )
{
std::string current_task_name = plan.tasks[i].get_name();
std::cout << "Found task name in \"" << configuration.get_plan_path() << "\":\t" << current_task_name << std::endl << std::endl;
Task current_task = plan.select_task_index( i );
Unit current_unit = unitHolder.select_unit( current_task_name );
Unit current_unit = unit_definitions.select_unit( current_task.get_name() );
std::cout << "Associated Unit name:\t\t" << current_unit.get_name() << std::endl;
std::cout << "Associated Unit target:\t\t" << current_unit.get_target() << std::endl;
std::cout << "Associated Unit healer:\t\t" << current_unit.get_rectifier() << std::endl;
std::cout << "Associated Unit heals:\t\t" << current_unit.get_rectify() << std::endl << std::endl;
std::cout << "Found task name in \"" << configuration.get_plan_path() << "\":\t" << current_task.get_name() << std::endl << std::endl;
std::cout << "Associated Unit name:\t\t" << current_unit.get_name() << std::endl;
std::cout << "Associated Unit target:\t\t" << current_unit.get_target() << std::endl;
std::cout << "Associated Unit healer:\t\t" << current_unit.get_rectifier() << std::endl;
std::cout << "Associated Unit heals:\t\t" << current_unit.get_rectify() << std::endl;
Json::Value deps = current_task.get_dependencies();
for ( int j = 0; j < deps.size(); ++j )
{
std::cout << "Associated Dependency:\t\t" << deps[j] << std::endl;
}
std::cout << std::endl;
}
return 0;