Orxonox  0.0.5 Codename: Arcturus
EnergyDrink.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 _EnergyDrink_H__
35 #define _EnergyDrink_H__
36 
37 #include "weapons/WeaponsPrereqs.h"
38 
39 #include <string>
40 #include "tools/Timer.h"
42 
43 namespace orxonox
44 {
45 
54  {
55  public:
56  EnergyDrink(Context* context);
57  virtual ~EnergyDrink() {}
58 
59  virtual bool fire(float* reloadTime) override;
60  virtual void fire() override;
61  virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
62 
63  private:
68  void setMaterial(const std::string& material)
69  { this->material_ = material; }
74  inline const std::string& getMaterial() const
75  { return this->material_; }
76 
77  void setDelay(float delay);
82  float getDelay() const
83  { return this->delay_; }
84 
85  void shot();
86  void muzzleflash();
87 
89  float speed_;
90  float delay_;
93  };
94 }
95 
96 #endif /* _EnergyDrink_H__ */
std::string material_
The material.
Definition: EnergyDrink.h:88
Timer delayTimer_
The timer to delay the firing.
Definition: EnergyDrink.h:91
::std::string string
Definition: gtest-port.h:756
Shared library macros, enums, constants and forward declarations for the weapons module ...
float speed_
The speed of the EnergyDrink.
Definition: EnergyDrink.h:89
const std::string & getMaterial() const
Get the material of the EnergyDrink.
Definition: EnergyDrink.h:74
Shoots a can.
Definition: EnergyDrink.h:53
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 getDelay() const
Get the firing delay.
Definition: EnergyDrink.h:82
void setMaterial(const std::string &material)
Set the material of the EnergyDrink.
Definition: EnergyDrink.h:68
Die Wagnis Klasse hat die folgenden Aufgaben:
Definition: ApplicationPaths.cc:66
Mode
Definition: CorePrereqs.h:102
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
bool timerStarted_
Definition: EnergyDrink.h:92
virtual ~EnergyDrink()
Definition: EnergyDrink.h:57
Timer is a helper class that executes a function after a given amount of seconds in game-time...
Definition: Timer.h:105
float delay_
The firing delay.
Definition: EnergyDrink.h:90
#define _WeaponsExport
Definition: WeaponsPrereqs.h:60