feat: implemented set/get_goals for Planner

This commit is contained in:
Sara 2024-03-30 23:12:24 +01:00
parent e1fd4b8e8d
commit 8017194b0c

View file

@ -194,4 +194,22 @@ Array Planner::get_actions() const {
}
return array;
}
void Planner::set_goals(Array value) {
this->goals.clear();
this->goals.resize(value.size());
for(size_t i{0}; i < value.size(); ++i) {
Ref<Goal> goal = value[i];
if(goal.is_valid())
this->goals.set(i, goal);
}
}
Array Planner::get_goals() const {
Array array{};
for(Ref<Goal> const &goal : this->goals) {
array.push_back(goal);
}
return array;
}
}