Orxonox  0.0.5 Codename: Arcturus
ShrinkPickup.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  * Sandro Sgier
24  * Co-authors:
25  * ...
26  *
27  */
28 
36 #ifndef _ShrinkPickup_H__
37 #define _ShrinkPickup_H__
38 
39 #include "pickup/PickupPrereqs.h"
40 
41 #include <string>
42 #include <vector>
43 
44 #include "pickup/Pickup.h"
46 
47 namespace orxonox {
48 
71  class _PickupExport ShrinkPickup : public Pickup, public Tickable
72  {
73  public:
74  ShrinkPickup(Context* context); // Constructor.
75  virtual ~ShrinkPickup(); // Destructor.
76 
77  virtual void XMLPort(Element& xmlelement, orxonox::XMLPort::Mode mode);
78  virtual void tick(float dt);
79 
80  virtual void changedUsed(void); // Is called when the pickup has transited from used to unused or the other way around.
81  virtual void changedPickedUp(void);
82 
87  inline float getShrinkFactor(void) const
88  { return this->shrinkFactor_; }
89  void setShrinkFactor(float factor);
90 
95  inline float getDuration(void) const
96  { return this->duration_; }
97  void setDuration(float duration);
98 
103  inline float getShrinkDuration(void) const
104  { return this->shrinkDuration_; }
105  void setShrinkDuration(float speed);
106 
107  private:
108  void initialize(void);
109 
110  float duration_;
113 
114  bool isActive_;
117 
120 
121  Pawn* carrierToPawnHelper(void);
123  void terminate(void);
124  };
125 }
126 
127 #endif
float shrinkDuration_
Duration of shrinking.
Definition: ShrinkPickup.h:112
Everything in Orxonox that has a health attribute is a Pawn.
Definition: Pawn.h:56
#define _PickupExport
Definition: PickupPrereqs.h:60
float getShrinkFactor(void) const
Get the shrinking factor.
Definition: ShrinkPickup.h:87
Declaration of the Pickup class.
Declaration of the Tickable interface.
bool isShrinking_
True if ship is shrinking.
Definition: ShrinkPickup.h:115
bool isTerminating_
True if ship is growing back to the original size.
Definition: ShrinkPickup.h:116
bool isActive_
True if ship is shrinking, small, or growing back.
Definition: ShrinkPickup.h:114
float shrinkFactor_
Shrink factor of the space ship.
Definition: ShrinkPickup.h:111
float currentFactor_
The shrink factor that is currently applied.
Definition: ShrinkPickup.h:118
xmlelement
Definition: Super.h:519
Timer durationTimer_
Definition: ShrinkPickup.h:122
Die Wagnis Klasse hat die folgenden Aufgaben:
Definition: ApplicationPaths.cc:66
Mode
Definition: CorePrereqs.h:102
float duration_
Determines how long the pickup will be active.
Definition: ShrinkPickup.h:110
Definition: Context.h:45
The ShrinkPickup is a Pickupable that causes the pawn to shrink to a certain size for a certain time ...
Definition: ShrinkPickup.h:71
The Pickup class offers (useful) base functionality for a wide range of pickups.
Definition: Pickup.h:92
float getDuration(void) const
Get the duration for which the ship remains shrunken.
Definition: ShrinkPickup.h:95
float getShrinkDuration(void) const
Get the shrink speed.
Definition: ShrinkPickup.h:103
Shared library macros, enums, constants and forward declarations for the questsystem module ...
The Tickable interface provides a tick(dt) function, that gets called every frame.
Definition: Tickable.h:52
Timer is a helper class that executes a function after a given amount of seconds in game-time...
Definition: Timer.h:105
float timeRemainig_
The remaining shrink time.
Definition: ShrinkPickup.h:119