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

@@ -2,25 +2,28 @@
#include "src/json/json.h"
#include "src/loaders/loaders.h"
int main()
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");
Conf configuration = Conf( "config.json" );
// 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();
Suite unit_definitions = Suite( definitions_file );
Suite * unit_definitions = new Suite();
unit_definitions->load_file( definitions_file );
Plan plan = Plan( plan_file );
for ( int i = 0; i < plan.num_tasks(); ++i )
{
Task current_task = plan.get_task(i);
Task current_task = plan.get_task( i );
Unit current_unit = unit_definitions.get_unit(current_task.get_name());
Unit current_unit = unit_definitions->get_unit( current_task.get_name() );
std::cout << "Found task name in \"" << configuration.get_plan_path() << "\":\t" << current_task.get_name() << std::endl << std::endl;