- Timestamp:
- May 26, 2011, 10:03:32 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/spacerace/src/modules/gametypes/SpaceRace.h
r8552 r8616 40 40 namespace orxonox 41 41 { 42 /* class PlayerScore { 43 public: 44 PlayerScore() { 45 this->name = ""; 46 this->time =0; 47 } 48 PlayerScore(std::string name, float time) { 49 this->name_ = name; 50 this->time_ = time; 51 } 52 PlayerScore(float time) { 53 this->name_ = "Player"; 54 this->time_ = time; 55 } 56 57 private: 58 std::string name_; 59 float time_; 60 };*/ 61 42 /** 43 @brief 44 The SpaceRace class enables the creation of a space race level, where the player has to reach check points in a given order. 45 */ 62 46 class _OrxonoxExport SpaceRace : public Gametype 63 47 { … … 74 58 75 59 inline void setCheckpointsReached(int n) 76 { this-> checkpointsReached_ = n;}60 { this->bCheckpointsReached_ = n;} 77 61 inline int getCheckpointsReached() 78 { return this-> checkpointsReached_; }62 { return this->bCheckpointsReached_; } 79 63 inline void timeIsUp() 80 64 { this->bTimeIsUp_ = true;} 81 65 Clock *clock_; //The clock starts running at the beginning of the game. It is used to give the time at each check point, the give the time at the end of the game, and to stop the game if a check point is reached too late. 82 66 protected: 83 67 84 68 private: 85 int checkpointsReached_; 86 std::set<float> scores_; 87 Clock *clock_; 88 bool bTimeIsUp_; 69 int bCheckpointsReached_; //The current number of check points reached by the player. 70 std::set<float> scores_; //The times of the players are saved in a set. 71 bool bTimeIsUp_; //True if one of the check points is reached too late. 89 72 }; 90 73 }
Note: See TracChangeset
for help on using the changeset viewer.