Changeset 9016 for code/trunk/src/modules/gametypes/RaceCheckPoint.h
- Timestamp:
- Feb 15, 2012, 11:51:58 PM (12 years ago)
- Location:
- code/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
-
code/trunk/src/modules/gametypes/RaceCheckPoint.h
r8767 r9016 32 32 #include "gametypes/GametypesPrereqs.h" 33 33 34 #include "objects/triggers/DistanceTrigger.h" 34 35 36 #include "objects/triggers/DistanceMultiTrigger.h" 35 37 #include "interfaces/RadarViewable.h" 36 38 … … 40 42 @brief 41 43 The RaceCheckPoint class enables the creation of a check point to use in a SpaceRace level. 42 !!! Don't forget to control the indexes of your check points and to set one last check point!!!44 Don't forget to control the indexes of your check points and to set one last check point 43 45 */ 44 class _GametypesExport RaceCheckPoint : public Distance Trigger, public RadarViewable46 class _GametypesExport RaceCheckPoint : public DistanceMultiTrigger, public RadarViewable 45 47 { 46 48 public: … … 50 52 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); 51 53 virtual void tick(float dt); 54 inline void setCheckpointIndex(int checkpointIndex) 55 { this->bCheckpointIndex_ = checkpointIndex; } 56 inline int getCheckpointIndex() 57 { return this->bCheckpointIndex_; } 52 58 53 protected: 54 virtual void triggered(bool bIsTriggered); 59 inline void setNextcheckpoint(const Vector3& checkpoints) 60 { this->nextcheckpoints_=checkpoints; } 61 inline void setNextcheckpoint(float x, float y, float z) 62 { this->setNextcheckpoint(Vector3(x, y, z)); } 63 inline const Vector3& getNextcheckpoint() const 64 { return this->nextcheckpoints_; } 55 65 inline void setLast(bool isLast) 56 66 { this->bIsLast_ = isLast; } 57 67 inline bool getLast() 58 68 { return this->bIsLast_; } 59 inline void setCheckpointIndex(int checkpointIndex) 60 { this->bCheckpointIndex_ = checkpointIndex; } 61 inline int getCheckpointIndex() 62 { return this->bCheckpointIndex_; } 69 70 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. 71 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. 72 PlayerInfo* reached_; 73 74 inline float getTimeLimit() 75 { return this->bTimeLimit_; } 76 77 protected: 78 virtual void fire(bool bIsTriggered,BaseObject* player); 63 79 virtual void setTimelimit(float timeLimit); 64 inline float getTimeLimit() 65 { return this->bTimeLimit_;} 80 66 81 inline const WorldEntity* getWorldEntity() const 67 82 { return this; } 68 83 69 84 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 85 int bCheckpointIndex_; //The index of this check point. The race starts with the check point with the index 0 86 Vector3 nextcheckpoints_; //the indexes of the next check points 87 74 88 }; 75 89 }
Note: See TracChangeset
for help on using the changeset viewer.