#ifndef WEAPON_INVENTORY_H #define WEAPON_INVENTORY_H #include "scene/main/node.h" #include "scene/resources/packed_scene.h" class PlayerBody; class WeaponBase; class WeaponInventory : public Node { GDCLASS(WeaponInventory, Node); static void _bind_methods(); void on_switch_input(); void stow_current_weapon(); void ready(); protected: void _notification(int what); public: void set_fallback_weapon(Ref scene); Ref get_fallback_weapon() const; void select_weapon(WeaponBase *next); WeaponBase *get_current_weapon() const; void pickup_weapon(Ref weapon_scene); private: Node3D *weapon_parent{ nullptr }; unsigned current{ 0 }; LocalVector weapons{ nullptr, nullptr }; WeaponBase *current_weapon{ nullptr }; WeaponBase *fallback_weapon{ nullptr }; Ref fallback_weapon_scene{}; }; #endif // !WEAPON_INVENTORY_H