feat: added Unit::has_plan
This commit is contained in:
		
							parent
							
								
									1b8563a5eb
								
							
						
					
					
						commit
						0bb0b26d3e
					
				|  | @ -99,6 +99,10 @@ int Unit::get_configure_team() const { | ||||||
|     return this->team; |     return this->team; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | bool Unit::has_plan() const { | ||||||
|  |     return !this->current_plan.size(); | ||||||
|  | } | ||||||
|  | 
 | ||||||
| void Unit::set_goal_and_plan(gd::Ref<goap::Goal> goal) { | void Unit::set_goal_and_plan(gd::Ref<goap::Goal> goal) { | ||||||
|     this->current_goal = goal; |     this->current_goal = goal; | ||||||
|     this->current_plan = this->planner->plan_for_goal(goal); |     this->current_plan = this->planner->plan_for_goal(goal); | ||||||
|  |  | ||||||
|  | @ -41,6 +41,7 @@ public: | ||||||
|     UnitTeam get_team() const; |     UnitTeam get_team() const; | ||||||
|     void set_configure_team(int value); |     void set_configure_team(int value); | ||||||
|     int get_configure_team() const; |     int get_configure_team() const; | ||||||
|  |     bool has_plan() const; | ||||||
| private: | private: | ||||||
|     void set_goal_and_plan(gd::Ref<goap::Goal> goal); |     void set_goal_and_plan(gd::Ref<goap::Goal> goal); | ||||||
|     void destroy_state(); |     void destroy_state(); | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue
	
	 Sara
						Sara