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

View File

@@ -1,43 +1,18 @@
//
// Created by phanes on 4/22/17.
//
#include "Plan.h"
Task::Task( Json::Value loader_root )
{
this->name = loader_root.get("name", "?").asString();
this->dependencies = loader_root.get("depends on", "");
this->has_succeeded = false;
}
std::string Task::get_name() { return this->name; }
bool Task::isDone() { return this->has_succeeded; }
void Task::finish() { this->has_succeeded = true; }
// returns Json::Value for dependencies
Json::Value Task::get_dependencies() { return this->dependencies;}
Json::Value Task::set_dependencies()
{
}
int Plan::num_tasks()
// returns the number of tasks in a Plan
{
return (int)this->tasks.size();
}
Task Plan::select_task_index(int index)
Task Plan::get_task(int index)
// returns a task from its parent Plan by index
{
return this->tasks[index];
}
Task Plan::select_task( std::string provided_name )
Task Plan::get_task(std::string provided_name)
/*
* returns a task from a Plan object by name
* this will need reworked. maybe should return int, populate a pointer.