Changeset 10916 for code/branches/cpp11_v2/src/modules/objects
- Timestamp:
- Dec 2, 2015, 11:22:03 PM (9 years ago)
- Location:
- code/branches/cpp11_v2/src/modules/objects
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/cpp11_v2/src/modules/objects/Attacher.cc
r10821 r10916 61 61 SUPER(Attacher, changedActivity); 62 62 63 for ( auto & elem: this->objects_)64 (elem)->setActive(this->isActive());63 for (WorldEntity* object : this->objects_) 64 object->setActive(this->isActive()); 65 65 } 66 66 … … 69 69 SUPER(Attacher, changedVisibility); 70 70 71 for ( auto & elem: this->objects_)72 (elem)->setVisible(this->isVisible());71 for (WorldEntity* object : this->objects_) 72 object->setVisible(this->isVisible()); 73 73 } 74 74 … … 83 83 { 84 84 unsigned int i = 0; 85 for ( const auto & elem: this->objects_)85 for (WorldEntity* object : this->objects_) 86 86 { 87 87 if (i == index) 88 return (elem);88 return object; 89 89 90 90 ++i; -
code/branches/cpp11_v2/src/modules/objects/Script.cc
r10821 r10916 196 196 { 197 197 const std::map<unsigned int, PlayerInfo*> clients = PlayerManager::getInstance().getClients(); 198 for(const auto & client: clients)198 for(const auto& mapEntry : clients) 199 199 { 200 callStaticNetworkFunction(&Script::executeHelper, client.first, this->getCode(), this->getMode(), this->getNeedsGraphics());200 callStaticNetworkFunction(&Script::executeHelper, mapEntry.first, this->getCode(), this->getMode(), this->getNeedsGraphics()); 201 201 if(this->times_ != Script::INF) // Decrement the number of remaining executions. 202 202 { -
code/branches/cpp11_v2/src/modules/objects/SpaceBoundaries.cc
r10821 r10916 59 59 this->pawnsIn_.clear(); 60 60 61 for( auto & elem: this->billboards_)61 for(BillboardAdministration& billboard : this->billboards_) 62 62 { 63 if( elem.billy != nullptr)64 { 65 delete elem.billy;63 if( billboard.billy != nullptr) 64 { 65 delete billboard.billy; 66 66 } 67 67 } … … 138 138 void SpaceBoundaries::removeAllBillboards() 139 139 { 140 for( auto & elem: this->billboards_)141 { 142 elem.usedYet = false;143 elem.billy->setVisible(false);140 for(BillboardAdministration& billboard : this->billboards_) 141 { 142 billboard.usedYet = false; 143 billboard.billy->setVisible(false); 144 144 } 145 145 } … … 208 208 float distance; 209 209 bool humanItem; 210 for(auto currentPawn : pawnsIn_) 211 { 212 210 for(Pawn* currentPawn : pawnsIn_) 211 { 213 212 if( currentPawn && currentPawn->getNode() ) 214 213 { -
code/branches/cpp11_v2/src/modules/objects/eventsystem/EventDispatcher.cc
r10821 r10916 45 45 { 46 46 if (this->isInitialized()) 47 for ( auto & elem: this->targets_)48 (elem)->destroy();47 for (BaseObject* target : this->targets_) 48 target->destroy(); 49 49 } 50 50 … … 61 61 void EventDispatcher::processEvent(Event& event) 62 62 { 63 for ( auto & elem: this->targets_)64 (elem)->processEvent(event);63 for (BaseObject* target : this->targets_) 64 target->processEvent(event); 65 65 } 66 66 … … 73 73 { 74 74 unsigned int i = 0; 75 for ( const auto & elem: this->targets_)75 for (BaseObject* target : this->targets_) 76 76 { 77 77 if (i == index) 78 return (elem);78 return target; 79 79 ++i; 80 80 } -
code/branches/cpp11_v2/src/modules/objects/eventsystem/EventFilter.cc
r10821 r10916 96 96 { 97 97 unsigned int i = 0; 98 for ( const auto & elem: this->sources_)98 for (BaseObject* source : this->sources_) 99 99 { 100 100 if (i == index) 101 return (elem);101 return source; 102 102 ++i; 103 103 } … … 113 113 { 114 114 unsigned int i = 0; 115 for ( const auto & elem: this->names_)115 for (EventName* name : this->names_) 116 116 { 117 117 if (i == index) 118 return (elem);118 return name; 119 119 ++i; 120 120 } -
code/branches/cpp11_v2/src/modules/objects/triggers/DistanceMultiTrigger.cc
r10821 r10916 158 158 { 159 159 160 const std::set<WorldEntity*> attached = entity->getAttachedObjects();160 const std::set<WorldEntity*> attachedObjects = entity->getAttachedObjects(); 161 161 bool found = false; 162 for( const auto & elem : attached)162 for(WorldEntity* attachedObject : attachedObjects) 163 163 { 164 if( (elem)->isA(ClassIdentifier<DistanceTriggerBeacon>::getIdentifier()) && static_cast<DistanceTriggerBeacon*>(elem)->getName() == this->targetName_)164 if(attachedObject->isA(ClassIdentifier<DistanceTriggerBeacon>::getIdentifier()) && static_cast<DistanceTriggerBeacon*>(attachedObject)->getName() == this->targetName_) 165 165 { 166 166 found = true; -
code/branches/cpp11_v2/src/modules/objects/triggers/DistanceTrigger.cc
r10821 r10916 180 180 { 181 181 182 const std::set<WorldEntity*> attached = entity->getAttachedObjects();182 const std::set<WorldEntity*> attachedObjects = entity->getAttachedObjects(); 183 183 bool found = false; 184 for( const auto & elem : attached)184 for(WorldEntity* attachedObject : attachedObjects) 185 185 { 186 if( (elem)->isA(ClassIdentifier<DistanceTriggerBeacon>::getIdentifier()) && static_cast<DistanceTriggerBeacon*>(elem)->getName() == this->targetName_)186 if(attachedObject->isA(ClassIdentifier<DistanceTriggerBeacon>::getIdentifier()) && static_cast<DistanceTriggerBeacon*>(attachedObject)->getName() == this->targetName_) 187 187 { 188 188 found = true; -
code/branches/cpp11_v2/src/modules/objects/triggers/MultiTrigger.cc
r10821 r10916 504 504 bool MultiTrigger::checkAnd(BaseObject* triggerer) 505 505 { 506 for(auto trigger : this->children_) 507 { 508 506 for(TriggerBase* trigger : this->children_) 507 { 509 508 if(trigger->isMultiTrigger()) 510 509 { … … 531 530 bool MultiTrigger::checkOr(BaseObject* triggerer) 532 531 { 533 for(auto trigger : this->children_) 534 { 535 532 for(TriggerBase* trigger : this->children_) 533 { 536 534 if(trigger->isMultiTrigger()) 537 535 { … … 559 557 { 560 558 bool triggered = false; 561 for(auto trigger : this->children_) 562 { 563 559 for(TriggerBase* trigger : this->children_) 560 { 564 561 if(triggered) 565 562 { -
code/branches/cpp11_v2/src/modules/objects/triggers/Trigger.cc
r10821 r10916 234 234 { 235 235 // Iterate over all sub-triggers. 236 for ( const auto & elem: this->children_)237 { 238 if (! (elem)->isActive())236 for (TriggerBase* child : this->children_) 237 { 238 if (!child->isActive()) 239 239 return false; 240 240 } … … 252 252 { 253 253 // Iterate over all sub-triggers. 254 for ( const auto & elem: this->children_)255 { 256 if ( (elem)->isActive())254 for (TriggerBase* child : this->children_) 255 { 256 if (child->isActive()) 257 257 return true; 258 258 } … … 270 270 { 271 271 bool test = false; 272 for ( const auto & elem: this->children_)273 { 274 if (test && (elem)->isActive())272 for (TriggerBase* child : this->children_) 273 { 274 if (test && child->isActive()) 275 275 return false; 276 if ( (elem)->isActive())276 if (child->isActive()) 277 277 test = true; 278 278 }
Note: See TracChangeset
for help on using the changeset viewer.