Changeset 9016 for code/trunk/src/modules/gametypes/SpaceRace.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/SpaceRace.h
r8767 r9016 34 34 #include <set> 35 35 #include <string> 36 # include <vector> 36 37 37 38 #include <util/Clock.h> … … 39 40 #include "gametypes/Gametype.h" 40 41 41 #include " RaceCheckPoint.h"42 #include "SpaceRaceManager.h" 42 43 43 44 namespace orxonox … … 50 51 { 51 52 friend class RaceCheckPoint; 53 52 54 53 55 public: … … 58 60 virtual void end(); 59 61 60 virtual void newCheckpointReached(); 62 virtual void newCheckpointReached(SpaceRaceManager* p, int index,PlayerInfo* pl); 63 virtual void newCheckpointReached(RaceCheckPoint* p, PlayerInfo* pl); 61 64 62 inline void setCheckpointsReached(int n) 63 { this->checkpointsReached_ = n;} 64 inline int getCheckpointsReached() 65 { return this->checkpointsReached_; } 65 inline void setCheckpointReached(int n, PlayerInfo* p) 66 { this->checkpointReached_[p] = n;} 67 inline int getCheckpointReached(PlayerInfo* p) 68 { return this->checkpointReached_[p]; } 69 66 70 inline void timeIsUp() 67 71 { this->bTimeIsUp_ = true;} 72 void tick(float dt); 73 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. 68 74 75 76 bool allowPawnHit(Pawn* victim, Pawn* originator); 77 78 bool allowPawnDamage(Pawn* victim, Pawn* originator); 79 80 bool allowPawnDeath(Pawn* victim, Pawn* originator); 69 81 protected: 70 82 virtual void playerEntered(PlayerInfo* player); //!< Initializes values. 83 virtual bool playerLeft(PlayerInfo* player); //!< Manages all local variables. 71 84 private: 72 int checkpointsReached_; //The current number of check points reached by the player. 85 bool cantMove_; 86 std::map<PlayerInfo*, int>checkpointReached_; //The number of the last check point reached by each player. 73 87 std::set<float> scores_; //The times of the players are saved in a set. 74 88 bool bTimeIsUp_; //True if one of the check points is reached too late. 75 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. 89 90 int playersAlive_; 76 91 }; 77 92 }
Note: See TracChangeset
for help on using the changeset viewer.