Changeset 9706 in orxonox.OLD for branches/new_class_id
- Timestamp:
- Aug 25, 2006, 9:50:23 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/new_class_id/src/world_entities/spawning_point.cc
r9705 r9706 33 33 #include "converter.h" 34 34 35 #include "class_id.h" 35 36 CREATE_FACTORY( SpawningPoint, CL_SPAWNING_POINT ); 36 37 NewObjectListDefinitionID(SpawningPoint, CL_SPAWNING_POINT); 37 38 /** 38 39 * constructor … … 50 51 void SpawningPoint::init() 51 52 { 52 this-> setClassID(CL_SPAWNING_POINT, "SpawningPoint");53 this->registerObject(this, SpawningPoint::_objectList); 53 54 PRINTF(0)("Created SpawningPoint\n"); 54 55 … … 82 83 /* load teamId */ 83 84 LoadParam(root, "teamId", this, SpawningPoint, setTeamId) 84 85 .describe("sets teamId"); 85 86 } 86 87 … … 106 107 void SpawningPoint::spawn(Playable* entity) 107 108 { 108 const std::list<BaseObject*> * list = ClassList::getList( CL_PLAYABLE );109 110 109 bool found = false; 111 110 112 if ( !list ) 113 return; 114 115 for ( std::list<BaseObject*>::const_iterator it = list->begin(); it != list->end(); it++ ) 111 for (NewObjectList<Playable>::const_iterator it = Playable::objectList().begin(); 112 it != Playable::objectList().end(); 113 ++it) 116 114 { 117 115 if ( *it == entity ) … … 160 158 this->spawn(it->entity); 161 159 162 const std::list<BaseObject*> * list = ClassList::getList( CL_PLAYABLE );163 164 160 bool found = false; 165 161 166 if ( !list ) 167 return; 168 169 for ( std::list<BaseObject*>::const_iterator it2 = list->begin(); it2 != list->end(); it2++ ) 162 for (NewObjectList<Playable>::const_iterator it2 = Playable::objectList().begin(); 163 it2 != Playable::objectList().end(); 164 ++it2) 170 165 { 171 166 if ( *it2 == it->entity ) … … 200 195 */ 201 196 void SpawningPoint::draw() const 202 { 203 } 197 {} 204 198 205 199 void SpawningPoint::sendRespawnMessage( int uniqueId ) … … 241 235 Playable * playable = NULL; 242 236 243 const std::list<BaseObject*> * list = ClassList::getList( CL_SPAWNING_POINT ); 244 245 if ( list ) 246 { 247 for ( std::list<BaseObject*>::const_iterator it = list->begin(); it != list->end(); it++ ) 248 { 249 PRINTF(0)("%d:%d\n", dynamic_cast<SpawningPoint*>(*it)->getUniqueID(), spUniqueId); 250 if ( dynamic_cast<SpawningPoint*>(*it)->getUniqueID() == spUniqueId ) 251 { 252 sp = dynamic_cast<SpawningPoint*>(*it); 253 break; 254 } 237 for (NewObjectList<SpawningPoint>::const_iterator it = SpawningPoint::objectList().begin(); 238 it != SpawningPoint::objectList().end(); 239 ++it) 240 { 241 PRINTF(0)("%d:%d\n", (*it)->getUniqueID(), spUniqueId); 242 if ( (*it)->getUniqueID() == spUniqueId ) 243 { 244 sp = (*it); 245 break; 255 246 } 256 247 } … … 262 253 } 263 254 264 list = ClassList::getList( CL_PLAYABLE ); 265 266 if ( list ) 267 { 268 for ( std::list<BaseObject*>::const_iterator it = list->begin(); it != list->end(); it++ ) 269 { 270 if ( dynamic_cast<Playable*>(*it)->getUniqueID() == uniqueId ) 271 { 272 playable = dynamic_cast<Playable*>(*it); 273 break; 274 } 255 for (NewObjectList<Playable>::const_iterator it = Playable::objectList().begin(); 256 it != Playable::objectList().end(); 257 ++it) 258 { 259 if ( (*it)->getUniqueID() == uniqueId ) 260 { 261 playable = (*it); 262 break; 275 263 } 276 264 }
Note: See TracChangeset
for help on using the changeset viewer.