feat: work on running and weapon inventory
This commit is contained in:
parent
43c5863e89
commit
6cdb2cbd4f
7 changed files with 58 additions and 3 deletions
33
modules/wave_survival/weapon_inventory.h
Normal file
33
modules/wave_survival/weapon_inventory.h
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
#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 ready();
|
||||
void select_weapon(WeaponBase *next);
|
||||
protected:
|
||||
void _notification(int what);
|
||||
|
||||
public:
|
||||
void set_fallback_weapon(Ref<PackedScene> scene);
|
||||
Ref<PackedScene> get_fallback_weapon() const;
|
||||
|
||||
WeaponBase *get_current_weapon() const;
|
||||
|
||||
private:
|
||||
unsigned current{ 0 };
|
||||
LocalVector<WeaponBase *> weapons{ nullptr, nullptr };
|
||||
WeaponBase *current_weapon{ nullptr };
|
||||
WeaponBase *fallback_weapon{ nullptr };
|
||||
|
||||
Ref<PackedScene> default_weapon_scene{};
|
||||
};
|
||||
|
||||
#endif // !WEAPON_INVENTORY_H
|
||||
Loading…
Add table
Add a link
Reference in a new issue