#ifndef UNIT_WORLD_STATE_HPP
#define UNIT_WORLD_STATE_HPP

#include "goap/actor_world_state.hpp"
#include <godot_cpp/classes/navigation_agent3d.hpp>
#include <godot_cpp/classes/node3d.hpp>

class Unit;

class UnitWorldState : public goap::ActorWorldState {
    GDCLASS(UnitWorldState, goap::ActorWorldState);
    static void _bind_methods();
public:
    virtual void _enter_tree() override;
    bool get_can_see_target() const;
    bool get_is_at_target() const;
    bool get_is_target_dead() const;

    void set_target_node(gd::Node3D *node);
    gd::Node3D *get_target_node() const;
private:
    Unit *parent_unit{nullptr};
    gd::NavigationAgent3D *agent{nullptr};
    gd::Node3D *target_node{nullptr};
};

#endif // !UNIT_WORLD_STATE_HPP
