#ifndef UTILITY_LOCK_HPP #define UTILITY_LOCK_HPP #include "goal_marker.hpp" #include "item.hpp" #include #include namespace gd = godot; class UtilityLock : public GoalMarker { GDCLASS(UtilityLock, GoalMarker) static void _bind_methods(); public: bool can_use(Item const *with, Unit *by) const; bool begin_activate(Item const *with, Unit *by); bool finish_activate(Item const *with, Unit *by); virtual void _begin_activate(Item const *with, Unit *by) {} virtual void _finish_activate(Item const *with, Unit *by) {} void set_allowed_items(gd::Array array); gd::Array get_allowed_items() const; private: gd::HashSet allowed_items{}; Unit *user{nullptr}; }; #endif // !UTILITY_LOCK_HPP