#ifndef GOAL_MARKER_HPP
#define GOAL_MARKER_HPP

#include <godot_cpp/classes/area3d.hpp>

namespace godot {
class CharacterActor;
namespace goap {
    class Planner;
    class Goal;
}

class GoalMarker : public Area3D {
    GDCLASS(GoalMarker, Area3D);
    static void _bind_methods();
public:
    virtual bool is_point_on(Vector3 point);
    virtual Vector3 nearest_point_on(Vector3 near_to);

    void set_goal(Ref<goap::Goal> goal);
    Ref<goap::Goal> get_goal() const;
    void set_radius(float radius);
    float get_radius() const;
protected:
    Ref<goap::Goal> goal{nullptr};
    float radius{0.2f};
};

class LineGoalMarker : public GoalMarker {
    GDCLASS(LineGoalMarker, GoalMarker);
    static void _bind_methods();
public:
    virtual bool is_point_on(Vector3 point) override;
    virtual Vector3 nearest_point_on(Vector3 near_to) override;

    void set_extent(float left);
    float get_extent() const;
private:
    float extent{0.5f};
};
}

#endif // !GOAL_MARKER_HPP
