Changeset 8915 for code/branches/spaceraceTwo/src
- Timestamp:
- Nov 2, 2011, 2:51:40 PM (13 years ago)
- Location:
- code/branches/spaceraceTwo/src/modules/gametypes
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/spaceraceTwo/src/modules/gametypes/RaceCheckPoint.cc
r8858 r8915 55 55 RaceCheckPoint::~RaceCheckPoint() 56 56 { 57 //if (this->isInitialized()) 58 { 59 //for (size_t i = 0; i < this->nextcheckpoints_.size(); ++i) 60 // this->nextcheckpoints_[i]->destroy(); 61 } 62 nextcheckpoints_.clear(); 57 63 } 58 64 … … 76 82 XMLPortParam(RaceCheckPoint, "islast", setLast, getLast, xmlelement, mode).defaultValues(false); 77 83 XMLPortParam(RaceCheckPoint, "timelimit", setTimelimit, getTimeLimit, xmlelement, mode).defaultValues(0); 84 //XMLPortParamTemplate(RaceCheckPoint, "nextcheckpoints", setNextcheckpoint, getNextcheckpoint, xmlelement, mode,std::vector<int>); 78 85 } 79 86 -
code/branches/spaceraceTwo/src/modules/gametypes/RaceCheckPoint.h
r8767 r8915 57 57 inline bool getLast() 58 58 { return this->bIsLast_; } 59 inline void setCheckpointIndex(int checkpointIndex) 59 60 inline void setCheckpointIndex(int checkpointIndex) 60 61 { this->bCheckpointIndex_ = checkpointIndex; } 61 62 inline int getCheckpointIndex() 62 63 { return this->bCheckpointIndex_; } 64 65 inline void setNextcheckpoint(std::vector<int> checkpoints) 66 { this->nextcheckpoints_ = checkpoints; } 67 inline std::vector<int> getNextcheckpoint() 68 { return this->nextcheckpoints_; } 63 69 virtual void setTimelimit(float timeLimit); 64 70 inline float getTimeLimit() … … 71 77 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 78 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. 79 80 std::vector<int> nextcheckpoints_; //the indexes of the next check points 73 81 74 82 }; -
code/branches/spaceraceTwo/src/modules/gametypes/SpaceRace.cc
r8911 r8915 135 135 } 136 136 137 void SpaceRace::tick(float dt)138 {SUPER(SpaceRace,tick,dt);139 137 140 141 //if(const_cast<GametypeInfo*>(this->getGametypeInfo())->isStartCountdownRunning()){142 //const_cast<GametypeInfo*>(this->getGametypeInfo())->start();}143 }144 138 145 139 -
code/branches/spaceraceTwo/src/modules/gametypes/SpaceRaceManager.cc
r8911 r8915 44 44 { 45 45 RegisterObject(SpaceRaceManager); 46 47 46 48 47 } 49 48 50 49 SpaceRaceManager::~SpaceRaceManager() 50 { 51 if (this->isInitialized()) 52 { 53 for (size_t i = 0; i < this->checkpoints_.size(); ++i) 54 this->checkpoints_[i]->destroy(); 55 } 56 } 57 58 void SpaceRaceManager::addCheckpoint(RaceCheckPoint* checkpoint) 59 { 60 this->checkpoints_.push_back(checkpoint); 61 } 62 63 RaceCheckPoint* SpaceRaceManager::getCheckpoint(unsigned int index) const 64 { 65 if (index < this->checkpoints_.size()) 66 return this->checkpoints_[index]; 67 else 68 return 0; 69 } 70 51 71 void SpaceRaceManager::XMLPort(Element& xmlelement, XMLPort::Mode mode) 52 72 { -
code/branches/spaceraceTwo/src/modules/gametypes/SpaceRaceManager.h
r8911 r8915 55 55 public: 56 56 SpaceRaceManager(BaseObject* creator); 57 virtual ~SpaceRaceManager() {}57 virtual ~SpaceRaceManager() ; 58 58 59 59 void XMLPort(Element& xmlelement, XMLPort::Mode mode); 60 60 61 61 void addCheckpoint(RaceCheckPoint* checkpoint); 62 RaceCheckPoint* getCheckpoint(unsigned int index) const; 63 62 64 void tick(float dt); 63 65 protected: 64 66 65 67 private: 68 std::vector<RaceCheckPoint*> checkpoints_; 66 69 }; 67 70 }
Note: See TracChangeset
for help on using the changeset viewer.