beginnings of plan and task re-impl
This commit is contained in:
@@ -1,9 +1,19 @@
|
|||||||
#include "Plan.h"
|
#include "Plan.h"
|
||||||
|
|
||||||
int Plan::num_tasks()
|
Plan::Plan(): JSON_Loader() {};
|
||||||
// returns the number of tasks in a Plan
|
|
||||||
|
void Plan::load_plan_file(std::string filename, bool verbose)
|
||||||
{
|
{
|
||||||
return (int)this->tasks.size();
|
// plan always loads from file
|
||||||
|
this->load_json_file( filename );
|
||||||
|
|
||||||
|
Json::Value raw_tasks = this->as_serialized()["plan"];
|
||||||
|
|
||||||
|
for ( int index = 0; index < raw_tasks.size(); index++ )
|
||||||
|
{
|
||||||
|
this->tasks.push_back( Task( raw_tasks[index] ) );
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Task Plan::get_task(int index)
|
Task Plan::get_task(int index)
|
||||||
@@ -39,19 +49,3 @@ Task Plan::get_task(std::string provided_name)
|
|||||||
|
|
||||||
return * returnable;
|
return * returnable;
|
||||||
}
|
}
|
||||||
|
|
||||||
Plan::Plan( std::string filename ): JSON_Loader()
|
|
||||||
// Plan loads a file and deserializes the Unit JSON object to Task types as a vector member
|
|
||||||
// Plan { vector<Task> }
|
|
||||||
{
|
|
||||||
// plan always loads from file
|
|
||||||
this->load_json_file( filename );
|
|
||||||
|
|
||||||
Json::Value raw_tasks = this->as_serialized()["plan"];
|
|
||||||
|
|
||||||
for ( int index = 0; index < raw_tasks.size(); index++ )
|
|
||||||
{
|
|
||||||
this->tasks.push_back( Task( raw_tasks[index] ) );
|
|
||||||
}
|
|
||||||
};
|
|
||||||
*/
|
|
||||||
@@ -21,8 +21,6 @@ class Plan: public JSON_Loader
|
|||||||
void get_task(Task & result, std::string provided_name, bool verbose);
|
void get_task(Task & result, std::string provided_name, bool verbose);
|
||||||
|
|
||||||
void get_task(Task & result, int index. bool verbose);
|
void get_task(Task & result, int index. bool verbose);
|
||||||
|
|
||||||
int num_tasks();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif //FTESTS_PLAN_H
|
#endif //FTESTS_PLAN_H
|
||||||
|
|||||||
Reference in New Issue
Block a user