Changeset 9869 in orxonox.OLD for trunk/src/world_entities/spawning_point.cc
- Timestamp:
- Oct 3, 2006, 12:19:30 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/spawning_point.cc
r9656 r9869 22 22 #include "world_entity.h" 23 23 24 #include "class_list.h"25 26 24 #include "compiler.h" 27 25 … … 35 33 #include "converter.h" 36 34 37 CREATE_FACTORY( SpawningPoint, CL_SPAWNING_POINT ); 38 35 #include "class_id_DEPRECATED.h" 36 ObjectListDefinitionID(SpawningPoint, CL_SPAWNING_POINT); 37 CREATE_FACTORY( SpawningPoint); 39 38 /** 40 39 * constructor … … 52 51 void SpawningPoint::init() 53 52 { 54 this-> setClassID(CL_SPAWNING_POINT, "SpawningPoint");53 this->registerObject(this, SpawningPoint::_objectList); 55 54 PRINTF(0)("Created SpawningPoint\n"); 56 55 … … 84 83 /* load teamId */ 85 84 LoadParam(root, "teamId", this, SpawningPoint, setTeamId) 86 85 .describe("sets teamId"); 87 86 } 88 87 … … 108 107 void SpawningPoint::spawn(Playable* entity) 109 108 { 110 const std::list<BaseObject*> * list = ClassList::getList( CL_PLAYABLE );111 112 109 bool found = false; 113 110 114 if ( !list ) 115 return; 116 117 for ( std::list<BaseObject*>::const_iterator it = list->begin(); it != list->end(); it++ ) 111 for (ObjectList<Playable>::const_iterator it = Playable::objectList().begin(); 112 it != Playable::objectList().end(); 113 ++it) 118 114 { 119 115 if ( *it == entity ) … … 162 158 this->spawn(it->entity); 163 159 164 const std::list<BaseObject*> * list = ClassList::getList( CL_PLAYABLE );165 166 160 bool found = false; 167 161 168 if ( !list ) 169 return; 170 171 for ( std::list<BaseObject*>::const_iterator it2 = list->begin(); it2 != list->end(); it2++ ) 162 for (ObjectList<Playable>::const_iterator it2 = Playable::objectList().begin(); 163 it2 != Playable::objectList().end(); 164 ++it2) 172 165 { 173 166 if ( *it2 == it->entity ) … … 202 195 */ 203 196 void SpawningPoint::draw() const 204 { 205 } 197 {} 206 198 207 199 void SpawningPoint::sendRespawnMessage( int uniqueId ) … … 243 235 Playable * playable = NULL; 244 236 245 const std::list<BaseObject*> * list = ClassList::getList( CL_SPAWNING_POINT ); 246 247 if ( list ) 248 { 249 for ( std::list<BaseObject*>::const_iterator it = list->begin(); it != list->end(); it++ ) 250 { 251 PRINTF(0)("%d:%d\n", dynamic_cast<SpawningPoint*>(*it)->getUniqueID(), spUniqueId); 252 if ( dynamic_cast<SpawningPoint*>(*it)->getUniqueID() == spUniqueId ) 253 { 254 sp = dynamic_cast<SpawningPoint*>(*it); 255 break; 256 } 237 for (ObjectList<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; 257 246 } 258 247 } … … 264 253 } 265 254 266 list = ClassList::getList( CL_PLAYABLE ); 267 268 if ( list ) 269 { 270 for ( std::list<BaseObject*>::const_iterator it = list->begin(); it != list->end(); it++ ) 271 { 272 if ( dynamic_cast<Playable*>(*it)->getUniqueID() == uniqueId ) 273 { 274 playable = dynamic_cast<Playable*>(*it); 275 break; 276 } 255 for (ObjectList<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; 277 263 } 278 264 }
Note: See TracChangeset
for help on using the changeset viewer.