chore: added comments, removed unused world_state_override
This commit is contained in:
		
							parent
							
								
									87d2cbd727
								
							
						
					
					
						commit
						60df329d1b
					
				| 
						 | 
				
			
			@ -131,8 +131,6 @@ Vector<Ref<Action>> Planner::make_plan(Ref<Goal> goal) {
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
Variant Planner::get_world_property(StringName prop_key) {
 | 
			
		||||
    if(world_state_override.has(prop_key))
 | 
			
		||||
        return world_state_override.get(prop_key);
 | 
			
		||||
    if(prop_key.begins_with("g_"))
 | 
			
		||||
        return this->global_world_state->get_world_property(prop_key);
 | 
			
		||||
    if(this->cached_world_state.has(prop_key))
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -58,13 +58,13 @@ public:
 | 
			
		|||
 | 
			
		||||
    void set_actions(Array actions);
 | 
			
		||||
    Array get_actions() const;
 | 
			
		||||
private:
 | 
			
		||||
    CharacterActor *actor{nullptr};
 | 
			
		||||
    WorldState world_state_override{};
 | 
			
		||||
    WorldState cached_world_state{};
 | 
			
		||||
    GlobalWorldState *global_world_state{nullptr};
 | 
			
		||||
 | 
			
		||||
    Vector<Ref<Action>> actions{};
 | 
			
		||||
private:
 | 
			
		||||
    CharacterActor *actor{nullptr}; // the parent actor of this planner
 | 
			
		||||
    WorldState cached_world_state{}; // the cached worldstate, cleared for every make_plan call
 | 
			
		||||
    GlobalWorldState *global_world_state{nullptr}; // cached singleton instance
 | 
			
		||||
    // configured settings
 | 
			
		||||
    Vector<Ref<Action>> actions{}; // available actions
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
struct PlannerNodeHasher {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue