Changeset 11071 for code/trunk/src/orxonox/infos
- Timestamp:
- Jan 17, 2016, 10:29:21 PM (9 years ago)
- Location:
- code/trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
-
code/trunk/src/orxonox/infos/Bot.h
r9667 r11071 45 45 void setConfigValues(); 46 46 47 inline bool isInitialized() const47 virtual inline bool isInitialized() const override 48 48 { return true; } 49 inline float getPing() const49 virtual inline float getPing() const override 50 50 { return 0; } 51 inline float getPacketLossRatio() const51 virtual inline float getPacketLossRatio() const override 52 52 { return 0; } 53 53 -
code/trunk/src/orxonox/infos/GametypeInfo.cc
r10624 r11071 291 291 if(GameMode::isMaster()) 292 292 { 293 NotificationListener::sendNotification("Press [Fire] to respawn", GametypeInfo::NOTIFICATION_SENDER, notificationMessageType::info, notificationSendMode::network, player->getClientID());293 NotificationListener::sendNotification("Press [Fire] to respawn", GametypeInfo::NOTIFICATION_SENDER, NotificationMessageType::info, NotificationSendMode::network, player->getClientID()); 294 294 // Remove the player from the list of players that have spawned, since it currently is not. 295 295 this->spawnedPlayers_.erase(player); … … 346 346 // Display "Press [Fire] to start the match" if the game has not yet ended. 347 347 if(!this->hasEnded()) 348 NotificationListener::sendNotification("Press [Fire] to start the match", GametypeInfo::NOTIFICATION_SENDER, notificationMessageType::info, notificationSendMode::network, player->getClientID());348 NotificationListener::sendNotification("Press [Fire] to start the match", GametypeInfo::NOTIFICATION_SENDER, NotificationMessageType::info, NotificationSendMode::network, player->getClientID()); 349 349 // Else display "Game has ended". 350 350 else 351 NotificationListener::sendNotification("Game has ended", GametypeInfo::NOTIFICATION_SENDER, notificationMessageType::info, notificationSendMode::network, player->getClientID());351 NotificationListener::sendNotification("Game has ended", GametypeInfo::NOTIFICATION_SENDER, NotificationMessageType::info, NotificationSendMode::network, player->getClientID()); 352 352 } 353 353 } … … 461 461 void GametypeInfo::dispatchAnnounceMessage(const std::string& message) const 462 462 { 463 for ( ObjectList<GametypeMessageListener>::iterator it = ObjectList<GametypeMessageListener>::begin(); it != ObjectList<GametypeMessageListener>::end(); ++it)464 it->announcemessage(this, message);463 for (GametypeMessageListener* listener : ObjectList<GametypeMessageListener>()) 464 listener->announcemessage(this, message); 465 465 } 466 466 467 467 void GametypeInfo::dispatchKillMessage(const std::string& message) const 468 468 { 469 for ( ObjectList<GametypeMessageListener>::iterator it = ObjectList<GametypeMessageListener>::begin(); it != ObjectList<GametypeMessageListener>::end(); ++it)470 it->killmessage(this, message);469 for (GametypeMessageListener* listener : ObjectList<GametypeMessageListener>()) 470 listener->killmessage(this, message); 471 471 } 472 472 473 473 void GametypeInfo::dispatchDeathMessage(const std::string& message) const 474 474 { 475 for ( ObjectList<GametypeMessageListener>::iterator it = ObjectList<GametypeMessageListener>::begin(); it != ObjectList<GametypeMessageListener>::end(); ++it)476 it->deathmessage(this, message);475 for (GametypeMessageListener* listener : ObjectList<GametypeMessageListener>()) 476 listener->deathmessage(this, message); 477 477 } 478 478 479 479 void GametypeInfo::dispatchStaticMessage(const std::string& message, const ColourValue& colour) const 480 480 { 481 for ( ObjectList<GametypeMessageListener>::iterator it = ObjectList<GametypeMessageListener>::begin(); it != ObjectList<GametypeMessageListener>::end(); ++it)482 it->staticmessage(this, message, colour);481 for (GametypeMessageListener* listener : ObjectList<GametypeMessageListener>()) 482 listener->staticmessage(this, message, colour); 483 483 } 484 484 485 485 void GametypeInfo::dispatchFadingMessage(const std::string& message) const 486 486 { 487 for ( ObjectList<GametypeMessageListener>::iterator it = ObjectList<GametypeMessageListener>::begin(); it != ObjectList<GametypeMessageListener>::end(); ++it)488 it->fadingmessage(this, message);487 for (GametypeMessageListener* listener : ObjectList<GametypeMessageListener>()) 488 listener->fadingmessage(this, message); 489 489 } 490 490 } -
code/trunk/src/orxonox/infos/HumanPlayer.cc
r10624 r11071 53 53 this->defaultController_ = Class(NewHumanController); 54 54 55 this->humanHud_ = 0;56 this->gametypeHud_ = 0;55 this->humanHud_ = nullptr; 56 this->gametypeHud_ = nullptr; 57 57 58 58 this->setConfigValues(); … … 178 178 { 179 179 this->humanHud_->destroy(); 180 this->humanHud_ = 0;180 this->humanHud_ = nullptr; 181 181 } 182 182 … … 194 194 { 195 195 this->gametypeHud_->destroy(); 196 this->gametypeHud_ = 0;196 this->gametypeHud_ = nullptr; 197 197 } 198 198 -
code/trunk/src/orxonox/infos/HumanPlayer.h
r10624 r11071 45 45 void setConfigValues(); 46 46 47 bool isInitialized() const;48 float getPing() const;49 float getPacketLossRatio() const;47 virtual bool isInitialized() const override; 48 virtual float getPing() const override; 49 virtual float getPacketLossRatio() const override; 50 50 51 51 void setClientID(unsigned int clientID); 52 52 53 virtual void switchGametype(Gametype* gametype) ;53 virtual void switchGametype(Gametype* gametype) override; 54 54 55 55 inline void setHumanHUDTemplate(const std::string& name) -
code/trunk/src/orxonox/infos/PlayerInfo.cc
r11052 r11071 51 51 this->bReadyToSpawn_ = false; 52 52 this->bSetUnreadyAfterSpawn_ = true; 53 this->controller_ = 0;54 this->controllableEntity_ = 0;53 this->controller_ = nullptr; 54 this->controllableEntity_ = nullptr; 55 55 this->controllableEntityID_ = OBJECTID_UNKNOWN; 56 56 57 this->gtinfo_ = 0;57 this->gtinfo_ = nullptr; 58 58 this->gtinfoID_ = OBJECTID_UNKNOWN; 59 59 this->updateGametypeInfo(this->getGametype()); … … 72 72 { 73 73 this->controller_->destroy(); 74 this->controller_ = 0;74 this->controller_ = nullptr; 75 75 } 76 76 … … 126 126 void PlayerInfo::updateGametypeInfo(Gametype* gametype) 127 127 { 128 this->gtinfo_ = 0;128 this->gtinfo_ = nullptr; 129 129 this->gtinfoID_ = OBJECTID_UNKNOWN; 130 130 … … 141 141 { 142 142 this->controller_->destroy(); 143 this->controller_ = 0;143 this->controller_ = nullptr; 144 144 } 145 145 this->controller_ = this->defaultController_.fabricate(this->getContext()); … … 181 181 182 182 RadarViewable* radarviewable = orxonox_cast<RadarViewable*>(entity); 183 if (radarviewable != NULL)183 if (radarviewable != nullptr) 184 184 radarviewable->setRadarName(this->getName()); 185 185 } … … 218 218 return; 219 219 220 this->controllableEntity_->setController( 0);221 this->controllableEntity_ = 0;220 this->controllableEntity_->setController(nullptr); 221 this->controllableEntity_ = nullptr; 222 222 this->controllableEntityID_ = OBJECTID_UNKNOWN; 223 223 224 224 if (this->controller_) 225 this->controller_->setControllableEntity( 0);225 this->controller_->setControllableEntity(nullptr); 226 226 227 227 if ( GameMode::isMaster() ) … … 239 239 240 240 Controller* tmp =this->controllableEntity_->getController(); 241 if (tmp == NULL)242 { 243 orxout(verbose) << "PlayerInfo: pauseControl, Controller is NULL" << endl;241 if (tmp == nullptr) 242 { 243 orxout(verbose) << "PlayerInfo: pauseControl, Controller is nullptr " << endl; 244 244 return; 245 245 } 246 246 tmp->setActive(false); 247 //this->controllableEntity_->getController()->setControllableEntity( NULL);248 this->controllableEntity_->setController( 0);247 //this->controllableEntity_->getController()->setControllableEntity(nullptr); 248 this->controllableEntity_->setController(nullptr); 249 249 } 250 250 … … 253 253 ControllableEntity* entity = this->controllableEntity_; 254 254 255 assert(this->controllableEntity_ != NULL);255 assert(this->controllableEntity_ != nullptr); 256 256 if( !entity || this->previousControllableEntity_.size() == 0 ) 257 257 return; … … 259 259 entity->destroyHud(); // HACK-ish 260 260 261 this->controllableEntity_->setController( 0);261 this->controllableEntity_->setController(nullptr); 262 262 if(this->isHumanPlayer()) // TODO: Multiplayer? 263 263 this->controllableEntity_->destroyHud(); // HACK-ish … … 266 266 do { 267 267 this->controllableEntity_ = this->previousControllableEntity_.back(); 268 } while(this->controllableEntity_ == NULL&& this->previousControllableEntity_.size() > 0);268 } while(this->controllableEntity_ == nullptr && this->previousControllableEntity_.size() > 0); 269 269 this->controllableEntityID_ = this->controllableEntity_->getObjectID(); 270 270 this->previousControllableEntity_.pop_back(); 271 271 272 if ( this->controllableEntity_ != NULL && this->controller_ != NULL)272 if ( this->controllableEntity_ != nullptr && this->controller_ != nullptr) 273 273 this->controller_->setControllableEntity(this->controllableEntity_); 274 274 275 275 // HACK-ish 276 if(this->controllableEntity_ != NULL&& this->isHumanPlayer())276 if(this->controllableEntity_ != nullptr && this->isHumanPlayer()) 277 277 this->controllableEntity_->createHud(); 278 278 -
code/trunk/src/orxonox/infos/PlayerInfo.h
r10624 r11071 44 44 virtual ~PlayerInfo(); 45 45 46 virtual void changedName() ;46 virtual void changedName() override; 47 47 virtual void switchGametype(Gametype* gametype); 48 48 … … 99 99 Controller* controller_; 100 100 ControllableEntity* controllableEntity_; 101 std::vector< WeakPtr<ControllableEntity>> previousControllableEntity_; //!< List of the previous ControllableEntities if repeatedly startTemporary control was called. The ControllableEntity at the back is the most recent.101 std::vector<WeakPtr<ControllableEntity>> previousControllableEntity_; //!< List of the previous ControllableEntities if repeatedly startTemporary control was called. The ControllableEntity at the back is the most recent. 102 102 unsigned int controllableEntityID_; 103 103
Note: See TracChangeset
for help on using the changeset viewer.