commented stuff

This commit is contained in:
Chris Punches
2017-04-29 20:32:09 -04:00
parent d62df8b076
commit 8a53aefd48
4 changed files with 35 additions and 47 deletions

View File

@@ -26,23 +26,24 @@ 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::select_task_index(int index)
// returns a task from its parent Plan by index
{
return this->tasks[index];
}
Task Plan::select_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.
* error handling is the concern here.
*/
{
{
Task * returnable;
bool foundMatch = false;
@@ -63,14 +64,13 @@ Task Plan::select_task( std::string provided_name )
}
return * returnable;
}
}
Plan::Plan( std::string filename ): JLoader( filename )
{
/* Plan loads a file and deserializes the Unit JSON object to Task types as a vector member
* Plan { vector<Task> }
*/
{
Json::Value raw_tasks = this->get_root()["plan"];
for ( int index = 0; index < raw_tasks.size(); index++ )