Orxonox  0.0.5 Codename: Arcturus
ShieldPickup.h
Go to the documentation of this file.
1 
2 /*
3  * ORXONOX - the hottest 3D action shooter ever to exist
4  * > www.orxonox.net <
5  *
6  *
7  * License notice:
8  *
9  * This program is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU General Public License
11  * as published by the Free Software Foundation; either version 2
12  * of the License, or (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22  *
23  * Author:
24  * Eric Beier
25  * Co-authors:
26  * ...
27  *
28  */
29 
36 #ifndef _ShieldPickup_H__
37 #define _ShieldPickup_H__
38 
39 #include "pickup/PickupPrereqs.h"
40 
41 #include <string>
42 
43 #include "pickup/Pickup.h"
44 
45 namespace orxonox {
46 
75  {
76  public:
77 
78  ShieldPickup(Context* context);
79  virtual ~ShieldPickup();
80 
81  virtual void XMLPort(Element& xmlelement, orxonox::XMLPort::Mode mode);
82 
83  virtual void changedUsed(void);
84 
89  inline float getDuration(void) const
90  { return this->duration_; }
95  inline float getShieldHealth() const
96  { return this->shieldHealth_; }
101  inline float getShieldAbsorption() const
102  { return this->shieldAbsorption_; }
103 
104  protected:
105  void pickupTimerCallback(void);
106 
107  void setDuration(float duration);
108  void setShieldHealth(float shieldHealth);
109  void setShieldAbsorption(float shieldAbsorption);
110 
111  private:
112  void initialize(void);
113  Pawn* carrierToPawnHelper(void);
114 
116 
117  float duration_;
120 
121  };
122 }
123 
124 #endif // _ShieldPickup_H__
Everything in Orxonox that has a health attribute is a Pawn.
Definition: Pawn.h:56
#define _PickupExport
Definition: PickupPrereqs.h:60
Declaration of the Pickup class.
float duration_
The health that is transferred to the Pawn.
Definition: ShieldPickup.h:117
float getShieldHealth() const
Get the shield health, the amount of damage the shield can sustain.
Definition: ShieldPickup.h:95
A Pickup which can add a Shield to the Pawn.
Definition: ShieldPickup.h:74
float getDuration(void) const
Get the duration, the time the shield is actvie at the most.
Definition: ShieldPickup.h:89
float shieldAbsorption_
The percentage of damage that is absorbed by the shield.
Definition: ShieldPickup.h:119
xmlelement
Definition: Super.h:519
Die Wagnis Klasse hat die folgenden Aufgaben:
Definition: ApplicationPaths.cc:66
float shieldHealth_
The amount of damage the shield can sustain.
Definition: ShieldPickup.h:118
Mode
Definition: CorePrereqs.h:102
Timer durationTimer_
Timer.
Definition: ShieldPickup.h:115
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 ...
float getShieldAbsorption() const
Get the shield absorption, the percentage of damage that is absorbed by the shield.
Definition: ShieldPickup.h:101
Timer is a helper class that executes a function after a given amount of seconds in game-time...
Definition: Timer.h:105