Voxellancer  0.3
A game about voxels in space
 All Classes Functions Pages
weapon.h
1 #pragma once
2 
3 #include <glm/glm.hpp>
4 #include <glm/gtc/quaternion.hpp>
5 
6 #include "equipment.h"
7 
8 class Sound;
9 class Hardpoint;
10 class Projectile;
11 class WorldObject;
12 class Visuals;
13 class SoundProperties;
14 
15 enum class WeaponType {
16  Gun,
18 };
19 
24 class Weapon: public Equipment {
25 public:
26  Weapon(WeaponType type, const std::string& equipmentKey);
27 
28  virtual const Visuals& visuals() const = 0;
29 
30  Hardpoint* hardpoint();
31  void setHardpoint(Hardpoint* hardpoint);
32 
33  WeaponType type() const;
34 
35  virtual float cooldownTime() const = 0;
36 
37  virtual void update(float deltaSec);
38 
39  bool canFire();
40  void onFired();
41 
42 
43 protected:
44  Hardpoint* m_hardpoint;
45  WeaponType m_type;
46 
47  float m_cooldown;
48 };
49 
Definition: worldobject.h:43
Definition: sound.h:12
Definition: rocketlauncher.h:12
Definition: weapon.h:24
Definition: equipment.h:6
Definition: hardpoint.h:18
Definition: projectile.h:12
Definition: visuals.h:11
Definition: gun.h:11
Definition: soundproperties.h:5