#ifndef PROJECTILE_POOL_HPP #define PROJECTILE_POOL_HPP #include "weapon_data.hpp" #include #include namespace godot { class ProjectilePool : public Node { GDCLASS(ProjectilePool, Node); static void _bind_methods(); public: virtual void _exit_tree() override; void set_data(Ref data); Ref get_data() const; Node3D *claim_projectile(); void return_projectile(Node3D *node); protected: Node3D *instantiate_new(bool active = false); private: Ref data{}; size_t count{0}; Vector active{}; Vector inactive{}; }; } #endif // !PROJECTILE_POOL_HPP