Orxonox  0.0.5 Codename: Arcturus
QuestEffectBeacon.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  * Damian 'Mozork' Frick
24  * Co-authors:
25  * ...
26  *
27  */
28 
35 #ifndef _QuestEffectBeacon_H__
36 #define _QuestEffectBeacon_H__
37 
39 
40 #include <list>
42 
43 namespace orxonox
44 {
45 
53  {
54  Inactive,
55  Active
56  };
57 
90  {
91  public:
92  QuestEffectBeacon(Context* context);
93  virtual ~QuestEffectBeacon();
94 
95  virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
96  virtual void XMLEventPort(Element& xmlelement, XMLPort::Mode mode) override;
97 
98  bool execute(bool bTriggered, BaseObject* trigger);
99 
104  inline bool isActive(void)
105  { return this->status_ == QuestEffectBeaconStatus::Active; }
106 
107  bool setActive(bool activate);
108 
109  protected:
110  bool decrementTimes(void);
111 
116  inline const int & getTimes(void) const
117  { return this->times_; }
118 
119  private:
120  static const int INFINITE_TIME = -1;
121 
122  std::list<QuestEffect*> effects_;
123  int times_;
125 
126  bool setTimes(const int & n);
127  bool addEffect(QuestEffect* effect);
128 
129  const QuestEffect* getEffect(unsigned int index) const;
130 
131  };
132 
133 }
134 
135 #endif /* _QuestEffectBeacon_H__ */
The BaseObject is the parent of all classes representing an instance in the game. ...
Definition: BaseObject.h:63
The StaticEntity is the simplest derivative of the orxonox::WorldEntity class.
Definition: StaticEntity.h:50
int times_
Number of times the beacon can be exectued.
Definition: QuestEffectBeacon.h:123
const int & getTimes(void) const
Returns the number of times the QUestEffectBeacon can still be executed.
Definition: QuestEffectBeacon.h:116
A QuestEffectBeacon is a physical entity in the game which can (under some condition(s)) invoke a num...
Definition: QuestEffectBeacon.h:89
xmlelement
Definition: Super.h:519
Handles QuestEffects for Quests.
Definition: QuestEffect.h:56
The Quest is inactive.
bool isActive(void)
Tests whether the QuestEffectBeacon is active.
Definition: QuestEffectBeacon.h:104
Die Wagnis Klasse hat die folgenden Aufgaben:
Definition: ApplicationPaths.cc:66
Mode
Definition: CorePrereqs.h:102
Shared library macros, enums, constants and forward declarations for the questsystem module ...
Definition: Context.h:45
The Quest is active.
QuestEffectBeaconStatus
The status of the QuestEffectBeacon, can be either active or inactive.
Definition: QuestEffectBeacon.h:52
QuestEffectBeaconStatus status_
The status of the QuestEffectBeacon, Can be eighter active or inactive.
Definition: QuestEffectBeacon.h:124
std::list< QuestEffect * > effects_
The list of QuestEffects to be invoked on the executing player.
Definition: QuestEffectBeacon.h:122
#define _QuestsystemExport
Definition: QuestsystemPrereqs.h:60