Orxonox  0.0.5 Codename: Arcturus
WagnisGun.h
Go to the documentation of this file.
1 #ifndef _WagnisGun__
2 #define _WagnisGun__
3 
5 
6 #include "tools/Timer.h"
8 
9 namespace orxonox
10 {
11 
20  {
21  public:
22  WagnisGun(Context* context);
23  virtual ~WagnisGun();
24 
25  virtual void fire() override;
26  virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
27 
28  protected:
33  void setMesh(const std::string& mesh)
34  { this->mesh_ = mesh; }
35 
40  const std::string& getMesh() const
41  { return this->mesh_; }
42 
47  void setSound(const std::string& sound)
48  { this->sound_ = sound; }
49 
54  const std::string& getSound() const
55  { return this->sound_; }
56 
61  void setMaterial(const std::string& material)
62  { this->material_ = material; }
67  const std::string& getMaterial() const
68  { return this->material_; }
69 
70  void setDelay(float delay);
75  float getDelay() const
76  { return this->delay_; }
77 
78  virtual void shot();
79  void muzzleflash();
80 
84 
85 
86 
87  float speed_;
88  float delay_;
90  };
91 }
92 
93 #endif /* _WagnisGun__ */
const std::string & getMesh() const
Get the mesh.
Definition: WagnisGun.h:40
void setSound(const std::string &sound)
Set the sound.
Definition: WagnisGun.h:47
const std::string & getSound() const
Get the sound.
Definition: WagnisGun.h:54
std::string sound_
The sound.
Definition: WagnisGun.h:83
float delay_
The firing delay.
Definition: WagnisGun.h:88
::std::string string
Definition: gtest-port.h:756
Shared library macros, enums, constants and forward declarations for the weapons module ...
void setMesh(const std::string &mesh)
Set the mesh.
Definition: WagnisGun.h:33
void setMaterial(const std::string &material)
Set the material.
Definition: WagnisGun.h:61
std::string material_
The material.
Definition: WagnisGun.h:81
xmlelement
Definition: Super.h:519
A WeaponMode defines how a Weapon is used.
Definition: WeaponMode.h:49
Declaration of the Timer class, used to call functions after a given time-interval.
float speed_
The speed of the fired projectile.
Definition: WagnisGun.h:87
Die Wagnis Klasse hat die folgenden Aufgaben:
Definition: ApplicationPaths.cc:66
Mode
Definition: CorePrereqs.h:102
Shoots laser beams.
Definition: WagnisGun.h:19
unsigned int delay(float delay, const std::string &command)
Console-command: Calls another console command after delay seconds (game time).
Definition: Timer.cc:65
Definition: Context.h:45
Timer delayTimer_
A timer to delay the firing.
Definition: WagnisGun.h:89
Timer is a helper class that executes a function after a given amount of seconds in game-time...
Definition: Timer.h:105
#define _WeaponsExport
Definition: WeaponsPrereqs.h:60
float getDelay() const
Get the firing delay.
Definition: WagnisGun.h:75
const std::string & getMaterial() const
Get the material.
Definition: WagnisGun.h:67
std::string mesh_
The mesh.
Definition: WagnisGun.h:82