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