Orxonox  0.0.5 Codename: Arcturus
HsW01.h
Go to the documentation of this file.
1 /*
2  * ORXONOX - the hottest 3D action shooter ever to exist
3  * > www.orxonox.net <
4  *
5  *
6  * License notice:
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * as published by the Free Software Foundation; either version 2
11  * of the License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21  *
22  * Author:
23  * Hagen Seifert
24  * Co-authors:
25  * ...
26  *
27  */
28 
34 #ifndef _HsW01_H__
35 #define _HsW01_H__
36 
37 #include "weapons/WeaponsPrereqs.h"
38 
39 #include "tools/Timer.h"
41 
42 namespace orxonox
43 {
44 
53  {
54  public:
55  HsW01(Context* context);
56  virtual ~HsW01();
57 
58  virtual void fire() override;
59  virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
60 
61  protected:
66  void setMesh(const std::string& mesh)
67  { this->mesh_ = mesh; }
68 
73  const std::string& getMesh() const
74  { return this->mesh_; }
75 
80  void setSound(const std::string& sound)
81  { this->sound_ = sound; }
82 
87  const std::string& getSound() const
88  { return this->sound_; }
89 
94  void setMaterial(const std::string& material)
95  { this->material_ = material; }
100  const std::string& getMaterial() const
101  { return this->material_; }
102 
103  void setDelay(float delay);
108  float getDelay() const
109  { return this->delay_; }
110 
111  virtual void shot();
112  void muzzleflash();
113 
117 
118 
119 
120  float speed_;
121  float delay_;
123  };
124 }
125 
126 #endif /* _HsW01_H__ */
::std::string string
Definition: gtest-port.h:756
float getDelay() const
Get the firing delay.
Definition: HsW01.h:108
Shared library macros, enums, constants and forward declarations for the weapons module ...
std::string mesh_
The mesh.
Definition: HsW01.h:115
void setSound(const std::string &sound)
Set the sound.
Definition: HsW01.h:80
void setMaterial(const std::string &material)
Set the material.
Definition: HsW01.h:94
const std::string & getSound() const
Get the sound.
Definition: HsW01.h:87
void setMesh(const std::string &mesh)
Set the mesh.
Definition: HsW01.h:66
Timer delayTimer_
A timer to delay the firing.
Definition: HsW01.h:122
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.
Die Wagnis Klasse hat die folgenden Aufgaben:
Definition: ApplicationPaths.cc:66
Mode
Definition: CorePrereqs.h:102
float speed_
The speed of the fired projectile.
Definition: HsW01.h:120
std::string material_
The material.
Definition: HsW01.h:114
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
const std::string & getMaterial() const
Get the material.
Definition: HsW01.h:100
Shoots laser beams.
Definition: HsW01.h:52
std::string sound_
The sound.
Definition: HsW01.h:116
float delay_
The firing delay.
Definition: HsW01.h:121
Timer is a helper class that executes a function after a given amount of seconds in game-time...
Definition: Timer.h:105
const std::string & getMesh() const
Get the mesh.
Definition: HsW01.h:73
#define _WeaponsExport
Definition: WeaponsPrereqs.h:60