Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/presentation2011/src/modules/gametypes/OldRaceCheckPoint.h @ 9000

Last change on this file since 9000 was 9000, checked in by jo, 12 years ago

Forgot to add new files.

File size: 3.1 KB
Line 
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 *      Mauro Salomon
24 *   Co-authors:
25 *      ...
26 *
27 */
28
29#ifndef _OldRaceCheckPoint_H__
30#define _OldRaceCheckPoint_H__
31
32#include "gametypes/GametypesPrereqs.h"
33
34#include "objects/triggers/DistanceTrigger.h"
35#include "interfaces/RadarViewable.h"
36
37namespace orxonox
38{
39    /**
40    @brief
41        The OldRaceCheckPoint class enables the creation of a check point to use in a OldSpaceRace level.
42        !!! Don't forget to control the indexes of your check points and to set one last check point!!!
43    */
44    class _GametypesExport OldRaceCheckPoint : public DistanceTrigger, public RadarViewable
45    {
46        public:
47            OldRaceCheckPoint(BaseObject* creator);
48            virtual ~OldRaceCheckPoint();
49
50            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
51            virtual void tick(float dt);
52
53            protected:
54            virtual void triggered(bool bIsTriggered);
55            inline void setLast(bool isLast)
56                { this->bIsLast_ = isLast; }
57            inline bool getLast()
58                { return this->bIsLast_; }
59            inline void setCheckpointIndex(int checkpointIndex)
60                { this->bCheckpointIndex_ = checkpointIndex; }
61            inline int getCheckpointIndex()
62                { return this->bCheckpointIndex_; }
63            virtual void setTimelimit(float timeLimit);
64            inline float getTimeLimit()
65                { return this->bTimeLimit_;}
66            inline const WorldEntity* getWorldEntity() const
67                { return this; }
68
69        private:
70            int bCheckpointIndex_; //The index of this check point. This value will be compared with the number of check points reached in the level. The check points must be indexed in ascending order beginning from zero and without any jumps between the indexes.
71            bool bIsLast_; //True if this check point is the last of the level. There can be only one last check point for each level and there must be a last check point in the level.
72            float bTimeLimit_; //The time limit (from the start of the level) to reach this check point. If the check point is reached after this time, the game ends and the player looses.
73     
74    };
75}
76
77#endif /* _OldRaceCheckPoint_H__ */
Note: See TracBrowser for help on using the repository browser.