Orxonox  0.0.5 Codename: Arcturus
SpeedPickup.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  * Eric Beier
24  * Co-authors:
25  * ...
26  *
27  */
28 
35 #ifndef _SpeedPickup_H__
36 #define _SpeedPickup_H__
37 
38 #include "pickup/PickupPrereqs.h"
39 
40 #include <string>
41 
42 #include "pickup/Pickup.h"
43 
44 namespace orxonox {
45 
74  {
75  public:
76 
77  SpeedPickup(Context* context);
78  virtual ~SpeedPickup();
79 
80  virtual void XMLPort(Element& xmlelement, orxonox::XMLPort::Mode mode);
81 
82  virtual void changedUsed(void);
83 
88  inline float getDuration(void) const
89  { return this->duration_; }
94  inline float getSpeedAdd(void) const
95  { return this->speedAdd_; }
100  inline float getSpeedMultiply(void) const
101  { return this->speedMultiply_; }
102 
103  protected:
104  void pickupTimerCallback(void);
105 
106  void setDuration(float duration);
107  void setSpeedAdd(float speedAdd);
108  void setSpeedMultiply(float speedMultiply);
109 
110  private:
111  void initialize(void);
112  SpaceShip* carrierToSpaceShipHelper(void);
113 
115 
116  float duration_;
117  float speedAdd_;
119  };
120 }
121 
122 #endif // _SpeedPickup_H__
#define _PickupExport
Definition: PickupPrereqs.h:60
A Pickup which can manipulate the Speed of a Pawn.
Definition: SpeedPickup.h:73
Declaration of the Pickup class.
float getSpeedAdd(void) const
Get the value that is added to the speed of the Pawn.
Definition: SpeedPickup.h:94
Timer durationTimer_
Timer.
Definition: SpeedPickup.h:114
xmlelement
Definition: Super.h:519
The SpaceShip is the principal entity through which the player interacts with the game...
Definition: SpaceShip.h:90
float getSpeedMultiply(void) const
Get the factor by wich the speed of the Pawn is multplied.
Definition: SpeedPickup.h:100
Die Wagnis Klasse hat die folgenden Aufgaben:
Definition: ApplicationPaths.cc:66
Mode
Definition: CorePrereqs.h:102
Definition: Context.h:45
The Pickup class offers (useful) base functionality for a wide range of pickups.
Definition: Pickup.h:92
Shared library macros, enums, constants and forward declarations for the questsystem module ...
Timer is a helper class that executes a function after a given amount of seconds in game-time...
Definition: Timer.h:105
float getDuration(void) const
Get the duration, the time the SpeedPickup is active.
Definition: SpeedPickup.h:88
float speedMultiply_
The factor by which the speed of the Pawn is multiplied.
Definition: SpeedPickup.h:118
float duration_
The time in seconds for which the SpeedPickup stays active.
Definition: SpeedPickup.h:116
float speedAdd_
The value that is added to the speed of the Pawn.
Definition: SpeedPickup.h:117