Changeset 9333
- Timestamp:
- Jul 22, 2012, 10:04:10 PM (12 years ago)
- Location:
- code/branches/presentation2012merge/src
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation2012merge/src/modules/gametypes/OldRaceCheckPoint.cc
r9271 r9333 112 112 const std::string& message = "You have " + multi_cast<std::string>(this->bTimeLimit_) 113 113 + " seconds to reach the check point " + multi_cast<std::string>(this->bCheckpointIndex_+1); 114 const_cast<GametypeInfo*>(gametype->getGametypeInfo())->sendAnnounceMessage(message);114 gametype->getGametypeInfo()->sendAnnounceMessage(message); 115 115 ChatManager::message(message); 116 116 } -
code/branches/presentation2012merge/src/modules/gametypes/OldSpaceRace.cc
r9271 r9333 58 58 + "You didn't reach the check point " + multi_cast<std::string>(this->checkpointsReached_+1) 59 59 + " before the time limit. You lose!"; 60 const_cast<GametypeInfo*>(this->getGametypeInfo())->sendAnnounceMessage(message);60 this->getGametypeInfo()->sendAnnounceMessage(message); 61 61 ChatManager::message(message); 62 62 } … … 68 68 const std::string& message = "You win!! You have reached the last check point after "+ multi_cast<std::string>(s) 69 69 + "." + multi_cast<std::string>(ms) + " seconds."; 70 const_cast<GametypeInfo*>(this->getGametypeInfo())->sendAnnounceMessage(message);70 this->getGametypeInfo()->sendAnnounceMessage(message); 71 71 ChatManager::message(message); 72 72 /* … … 85 85 86 86 std::string message("The match has started! Reach the check points as quickly as possible!"); 87 const_cast<GametypeInfo*>(this->getGametypeInfo())->sendAnnounceMessage(message);87 this->getGametypeInfo()->sendAnnounceMessage(message); 88 88 ChatManager::message(message); 89 89 } … … 98 98 + " reached after " + multi_cast<std::string>(s) + "." + multi_cast<std::string>(ms) 99 99 + " seconds."; 100 const_cast<GametypeInfo*>(this->getGametypeInfo())->sendAnnounceMessage(message);100 this->getGametypeInfo()->sendAnnounceMessage(message); 101 101 ChatManager::message(message); 102 102 } -
code/branches/presentation2012merge/src/modules/gametypes/RaceCheckPoint.cc
r9263 r9333 97 97 std::string message = "You have " + multi_cast<std::string>(this->timeLimit_) 98 98 + " seconds to reach the check point " + multi_cast<std::string>(this->checkpointIndex_ + 1); 99 const_cast<GametypeInfo*>(this->getGametype()->getGametypeInfo())->sendAnnounceMessage(message);99 this->getGametype()->getGametypeInfo()->sendAnnounceMessage(message); 100 100 ChatManager::message(message); 101 101 } -
code/branches/presentation2012merge/src/modules/gametypes/SpaceRace.cc
r9306 r9333 72 72 } 73 73 74 const_cast<GametypeInfo*>(this->getGametypeInfo())->sendAnnounceMessage(message);74 this->getGametypeInfo()->sendAnnounceMessage(message); 75 75 ChatManager::message(message); 76 76 } … … 99 99 100 100 std::string message = "The match has started! Reach the check points as quickly as possible!"; 101 const_cast<GametypeInfo*>(this->getGametypeInfo())->sendAnnounceMessage(message);101 this->getGametypeInfo()->sendAnnounceMessage(message); 102 102 ChatManager::message(message); 103 103 } … … 114 114 const std::string& message = "Checkpoint " + multi_cast<std::string>(checkpoint->getCheckpointIndex() + 1) 115 115 + " reached after " + multi_cast<std::string>(s) + "." + multi_cast<std::string>(ms) + " seconds."; 116 const_cast<GametypeInfo*>(this->getGametypeInfo())->sendAnnounceMessage(message);116 this->getGametypeInfo()->sendAnnounceMessage(message); 117 117 ChatManager::message(message); 118 118 } -
code/branches/presentation2012merge/src/modules/objects/triggers/CheckPoint.cc
r7601 r9333 109 109 if (bIsDestination_) 110 110 { 111 const_cast<GametypeInfo*>(gametype->getGametypeInfo())->sendAnnounceMessage("Congratulations - you have won the match!");111 gametype->getGametypeInfo()->sendAnnounceMessage("Congratulations - you have won the match!"); 112 112 gametype->end(); 113 113 } … … 115 115 if (!bIsFirst_ && !bIsDestination_) 116 116 { 117 const_cast<GametypeInfo*>(gametype->getGametypeInfo())->sendAnnounceMessage("Checkpoint reached");117 gametype->getGametypeInfo()->sendAnnounceMessage("Checkpoint reached"); 118 118 } 119 119 } -
code/branches/presentation2012merge/src/orxonox/infos/GametypeInfo.cc
r9016 r9333 68 68 { 69 69 RegisterObject(GametypeInfo); 70 70 71 71 this->bStarted_ = false; 72 72 this->bEnded_ = false; … … 165 165 if(this->bStarted_) 166 166 { return;} 167 167 168 168 this->bStarted_ = true; 169 169 this->changedStarted(); 170 171 170 171 172 172 } 173 173 … … 195 195 if(this->startCountdown_ == countdown || countdown < 0.0f) 196 196 return; 197 197 198 198 this->startCountdown_ = countdown; 199 199 // Set the counter to the ceiling of the current countdown. … … 225 225 if(this->counter_ == 0) 226 226 return; 227 227 228 228 this->counter_--; 229 229 this->changedCountdownCounter(); … … 325 325 if(this->spawned_ == spawned) 326 326 return; 327 327 328 328 this->spawned_ = spawned; 329 329 // Clear the notifications if the Player has spawned. … … 395 395 // TODO: Replace with notifications. 396 396 397 void GametypeInfo::sendAnnounceMessage(const std::string& message) 397 void GametypeInfo::sendAnnounceMessage(const std::string& message) const 398 398 { 399 399 if (GameMode::isMaster()) … … 404 404 } 405 405 406 void GametypeInfo::sendAnnounceMessage(const std::string& message, unsigned int clientID) 406 void GametypeInfo::sendAnnounceMessage(const std::string& message, unsigned int clientID) const 407 407 { 408 408 if (GameMode::isMaster()) … … 415 415 } 416 416 417 void GametypeInfo::sendKillMessage(const std::string& message, unsigned int clientID) 417 void GametypeInfo::sendKillMessage(const std::string& message, unsigned int clientID) const 418 418 { 419 419 if (GameMode::isMaster()) … … 426 426 } 427 427 428 void GametypeInfo::sendDeathMessage(const std::string& message, unsigned int clientID) 428 void GametypeInfo::sendDeathMessage(const std::string& message, unsigned int clientID) const 429 429 { 430 430 if (GameMode::isMaster()) … … 437 437 } 438 438 439 void GametypeInfo::sendStaticMessage(const std::string& message, unsigned int clientID, const ColourValue& colour) 439 void GametypeInfo::sendStaticMessage(const std::string& message, unsigned int clientID, const ColourValue& colour) const 440 440 { 441 441 if (GameMode::isMaster()) … … 448 448 } 449 449 450 void GametypeInfo::sendFadingMessage(const std::string& message, unsigned int clientID) 450 void GametypeInfo::sendFadingMessage(const std::string& message, unsigned int clientID) const 451 451 { 452 452 if (GameMode::isMaster()) … … 459 459 } 460 460 461 void GametypeInfo::dispatchAnnounceMessage(const std::string& message) 461 void GametypeInfo::dispatchAnnounceMessage(const std::string& message) const 462 462 { 463 463 for (ObjectList<GametypeMessageListener>::iterator it = ObjectList<GametypeMessageListener>::begin(); it != ObjectList<GametypeMessageListener>::end(); ++it) … … 465 465 } 466 466 467 void GametypeInfo::dispatchKillMessage(const std::string& message) 467 void GametypeInfo::dispatchKillMessage(const std::string& message) const 468 468 { 469 469 for (ObjectList<GametypeMessageListener>::iterator it = ObjectList<GametypeMessageListener>::begin(); it != ObjectList<GametypeMessageListener>::end(); ++it) … … 471 471 } 472 472 473 void GametypeInfo::dispatchDeathMessage(const std::string& message) 473 void GametypeInfo::dispatchDeathMessage(const std::string& message) const 474 474 { 475 475 for (ObjectList<GametypeMessageListener>::iterator it = ObjectList<GametypeMessageListener>::begin(); it != ObjectList<GametypeMessageListener>::end(); ++it) … … 477 477 } 478 478 479 void GametypeInfo::dispatchStaticMessage(const std::string& message, const ColourValue& colour) 479 void GametypeInfo::dispatchStaticMessage(const std::string& message, const ColourValue& colour) const 480 480 { 481 481 for (ObjectList<GametypeMessageListener>::iterator it = ObjectList<GametypeMessageListener>::begin(); it != ObjectList<GametypeMessageListener>::end(); ++it) … … 483 483 } 484 484 485 void GametypeInfo::dispatchFadingMessage(const std::string& message) 485 void GametypeInfo::dispatchFadingMessage(const std::string& message) const 486 486 { 487 487 for (ObjectList<GametypeMessageListener>::iterator it = ObjectList<GametypeMessageListener>::begin(); it != ObjectList<GametypeMessageListener>::end(); ++it) -
code/branches/presentation2012merge/src/orxonox/infos/GametypeInfo.h
r9016 r9333 68 68 { return this->bStarted_; } 69 69 void changedStarted(void); // Is called when the game has changed to started. 70 70 71 71 /** 72 72 @brief Get whether the game has ended yet. … … 108 108 { return this->readyToSpawn_; } 109 109 void changedReadyToSpawn(bool ready); // Inform the GametypeInfo that the local player has changed its spawned status. 110 110 111 111 /** 112 112 @brief Get whether the local player is spawned. … … 119 119 inline const std::string& getHUDTemplate() const 120 120 { return this->hudtemplate_; } 121 121 122 122 inline unsigned int getNumberOfPlayers() const 123 123 { return this->spawnedPlayers_.size(); } 124 124 125 void sendAnnounceMessage(const std::string& message) ;126 void sendAnnounceMessage(const std::string& message, unsigned int clientID) ;127 void sendKillMessage(const std::string& message, unsigned int clientID) ;128 void sendDeathMessage(const std::string& message, unsigned int clientID) ;129 void sendStaticMessage(const std::string& message, unsigned int clientID, const ColourValue& colour) ;130 void sendFadingMessage(const std::string& message, unsigned int clientID) ;125 void sendAnnounceMessage(const std::string& message) const; 126 void sendAnnounceMessage(const std::string& message, unsigned int clientID) const; 127 void sendKillMessage(const std::string& message, unsigned int clientID) const; 128 void sendDeathMessage(const std::string& message, unsigned int clientID) const; 129 void sendStaticMessage(const std::string& message, unsigned int clientID, const ColourValue& colour) const; 130 void sendFadingMessage(const std::string& message, unsigned int clientID) const; 131 131 132 void dispatchAnnounceMessage(const std::string& message) ;133 void dispatchKillMessage(const std::string& message) ;134 void dispatchDeathMessage(const std::string& message) ;135 void dispatchStaticMessage(const std::string& message,const ColourValue& colour) ;136 void dispatchFadingMessage(const std::string& message) ;137 132 void dispatchAnnounceMessage(const std::string& message) const; 133 void dispatchKillMessage(const std::string& message) const; 134 void dispatchDeathMessage(const std::string& message) const; 135 void dispatchStaticMessage(const std::string& message,const ColourValue& colour) const; 136 void dispatchFadingMessage(const std::string& message) const; 137 138 138 protected: 139 139 void start(void); // Inform the GametypeInfo that the game has started. … … 165 165 unsigned int counter_; //!< The current integer value of the start countdown, the start countdown counter. 166 166 std::string hudtemplate_; 167 167 168 168 std::set<PlayerInfo*> spawnedPlayers_; //!< A set of players that are currently spawned. 169 169 bool spawned_; //!< Whether the local Player is currently spawned.
Note: See TracChangeset
for help on using the changeset viewer.