#ifndef GOAP_GLOBAL_WORLD_STATE_HPP
#define GOAP_GLOBAL_WORLD_STATE_HPP

#include "action.hpp"
#include "tunnels_game_mode.hpp"
#include <godot_cpp/classes/node.hpp>

namespace godot::goap {
class GlobalWorldState : public Node {
    GDCLASS(GlobalWorldState, Node);
    static void _bind_methods();
public:
    static bool has_singleton();
    static GlobalWorldState *get_singleton();

    virtual void _enter_tree() override;
    virtual void _exit_tree() override;
    virtual void _process(double delta_time) override;

    Vector3 get_player_position() const;
    CharacterActor *get_player_character() const;

    Variant get_world_property(StringName prop_key);
private:
    WorldState global_state_cache{};
    static GlobalWorldState *singleton_instance;
};
}

#endif // !GOAP_GLOBAL_WORLD_STATE_HPP
