#ifndef RTS_ACTIONS_HPP
#define RTS_ACTIONS_HPP

#include "goap/action.hpp"
#include "goap/actor_world_state.hpp"

class MoveToTarget : public goap::Action {
    GOAP_ACTION(MoveToTarget);
public:
    MoveToTarget();
    virtual goap::State *get_apply_state(goap::ActorWorldState *context) const override;
};

class FireAtTarget : public goap::Action {
    GOAP_ACTION(FireAtTarget);
public:
    FireAtTarget();
    virtual goap::State *get_apply_state(goap::ActorWorldState *) const override;
};

class FindTarget : public goap::Action {
    GOAP_ACTION(FindTarget);
public:
    FindTarget();
    virtual goap::State *get_apply_state(goap::ActorWorldState *context) const override;
};

class GetInMeleeRange : public goap::Action {
    GOAP_ACTION(GetInMeleeRange);
public:
    GetInMeleeRange();
    virtual goap::State *get_apply_state(goap::ActorWorldState *context) const override;
};

class MeleeAttack : public goap::Action {
    GOAP_ACTION(MeleeAttack);
public:
    MeleeAttack();
    virtual goap::State *get_apply_state(goap::ActorWorldState *) const override;
};

class TankSelfHeal : public goap::Action {
    GOAP_ACTION(TankSelfHeal);
public:
    TankSelfHeal();
    virtual goap::State *get_apply_state(goap::ActorWorldState *) const override;
};

class TakeCover : public goap::Action {
    GOAP_ACTION(TakeCover);
public:
    TakeCover();
    virtual bool procedural_is_possible(goap::ActorWorldState *context) const override;
    virtual goap::State *get_apply_state(goap::ActorWorldState *context) const override;
private:
    static bool is_marker_cover_from(class NavMarker *marker, gd::Vector3 const &target_position, gd::Vector3 const &context_position);
    float score_cover_marker(class NavMarker *marker, gd::Vector3 const &target_position, gd::Vector3 const &context_position) const;
};

#endif // !RTS_ACTIONS_HPP
