feat: added Unit::has_plan

This commit is contained in:
Sara 2024-07-28 11:42:25 +02:00
parent 1b8563a5eb
commit 0bb0b26d3e
2 changed files with 5 additions and 0 deletions

View file

@ -99,6 +99,10 @@ int Unit::get_configure_team() const {
return this->team;
}
bool Unit::has_plan() const {
return !this->current_plan.size();
}
void Unit::set_goal_and_plan(gd::Ref<goap::Goal> goal) {
this->current_goal = goal;
this->current_plan = this->planner->plan_for_goal(goal);

View file

@ -41,6 +41,7 @@ public:
UnitTeam get_team() const;
void set_configure_team(int value);
int get_configure_team() const;
bool has_plan() const;
private:
void set_goal_and_plan(gd::Ref<goap::Goal> goal);
void destroy_state();