39 lines
843 B
C++
39 lines
843 B
C++
#ifndef WEAPON_BASE_H
|
|
#define WEAPON_BASE_H
|
|
|
|
#include "scene/3d/node_3d.h"
|
|
class AnimationPlayer;
|
|
class PlayerCamera;
|
|
class PlayerBody;
|
|
class PlayerInput;
|
|
|
|
class WeaponBase : public Node3D {
|
|
GDCLASS(WeaponBase, Node3D);
|
|
static void _bind_methods();
|
|
void ready();
|
|
|
|
protected:
|
|
void _notification(int what);
|
|
|
|
public:
|
|
void set_anim(AnimationPlayer *player);
|
|
AnimationPlayer *get_anim() const;
|
|
PlayerInput *get_input() const;
|
|
PlayerCamera *get_camera() const;
|
|
|
|
void set_body(PlayerBody *body);
|
|
PlayerBody *get_body() const;
|
|
|
|
virtual bool allows_running() const { return true; }
|
|
virtual bool allows_jumping() const { return true; }
|
|
virtual void notify_selected() {}
|
|
|
|
private:
|
|
PlayerInput *input{ nullptr };
|
|
AnimationPlayer *anim{ nullptr };
|
|
PlayerCamera *camera{ nullptr };
|
|
PlayerBody *body{ nullptr };
|
|
};
|
|
|
|
#endif // !WEAPON_BASE_H
|