Changeset 9869 in orxonox.OLD for trunk/src/util
- Timestamp:
- Oct 3, 2006, 12:19:30 AM (18 years ago)
- Location:
- trunk/src/util
- Files:
-
- 2 deleted
- 25 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/util/Makefile.am
r9494 r9869 4 4 noinst_LIBRARIES = libORXutils.a 5 5 6 libORXutils_a_SOURCES = fast_factory.cc\6 libORXutils_a_SOURCES = \ 7 7 object_manager.cc \ 8 8 state.cc \ … … 31 31 track/track_node.cc 32 32 33 noinst_HEADERS = fast_factory.h\33 noinst_HEADERS = \ 34 34 object_manager.h \ 35 35 state.h \ -
trunk/src/util/animation/animation.cc
r5777 r9869 20 20 #include "animation_player.h" 21 21 22 ObjectListDefinition(Animation); 22 23 /** 23 24 * creates a new Animation … … 27 28 Animation::Animation() 28 29 { 29 this-> setClassID(CL_ANIMATION, "Animation");30 this->registerObject(this, Animation::_objectList); 30 31 31 32 // initialize a beginning KeyFrame, that will be deleted afterwards -
trunk/src/util/animation/animation.h
r6222 r9869 73 73 class Animation : public BaseObject 74 74 { 75 public: 75 ObjectListDeclaration(Animation); 76 public: 76 77 virtual ~Animation(); 77 78 … … 95 96 inline bool ifDelete() { return bDelete; }; 96 97 97 98 protected: 98 99 Animation(); 99 100 100 101 void handleInfinity(); 101 102 102 103 protected: 103 104 // variables 104 105 float localTime; //!< The Time passed since the beginning of the currentKeyFrame. … … 119 120 class aTest 120 121 { 121 122 public: 122 123 inline aTest() { last = 0.0;} 123 124 /** a little debug information to show the results of this class @param f new value */ 124 125 inline void littleDebug(float f) { diff = f - last; printf("f=%f, diff=%f\n", f,diff); last = f;} 125 126 private: 126 127 float diff; //!< difference from the last value 127 128 float last; //!< the last calculated value -
trunk/src/util/animation/animation_player.cc
r9406 r9869 22 22 23 23 24 24 ObjectListDefinition(AnimationPlayer); 25 25 /** 26 26 * standard constructor … … 28 28 AnimationPlayer::AnimationPlayer () 29 29 { 30 this-> setClassID(CL_ANIMATION_PLAYER, "AnimationPlayer");30 this->registerObject(this, AnimationPlayer::_objectList); 31 31 this->setName("AnimationPlayer"); 32 32 -
trunk/src/util/animation/animation_player.h
r5777 r9869 28 28 eveything else will be done by the AnimationPlayer itself.\n 29 29 */ 30 class AnimationPlayer : public BaseObject { 30 class AnimationPlayer : public BaseObject 31 { 32 ObjectListDeclaration(AnimationPlayer); 31 33 32 34 public: 33 35 /** @returns a Pointer to the only object of this Class */ 34 36 inline static AnimationPlayer* getInstance() { if (!singletonRef) singletonRef = new AnimationPlayer(); return singletonRef; }; … … 50 52 void debug(); 51 53 52 54 private: 53 55 /* singleton */ 54 56 AnimationPlayer(); -
trunk/src/util/game_rules.cc
r9494 r9869 17 17 #include "game_rules.h" 18 18 19 #include "util/loading/load_param .h"19 #include "util/loading/load_param_xml.h" 20 20 #include "util/loading/factory.h" 21 21 … … 28 28 29 29 30 30 ObjectListDefinition(GameRules); 31 31 32 32 /** … … 35 35 GameRules::GameRules(const TiXmlElement* root) 36 36 { 37 this-> setClassID(CL_GAME_RULES, "GameRules");37 this->registerObject(this, GameRules::_objectList); 38 38 } 39 39 -
trunk/src/util/game_rules.h
r9008 r9869 23 23 class GameRules : virtual public BaseObject 24 24 { 25 ObjectListDeclaration(GameRules); 25 26 26 27 public: -
trunk/src/util/hud.cc
r9406 r9869 34 34 #include "playable.h" 35 35 36 ObjectListDefinition(Hud); 36 37 /** 37 38 * standard constructor … … 40 41 Hud::Hud () 41 42 { 42 this-> setClassID(CL_HUD, "Hud");43 this->registerObject(this, Hud::_objectList); 43 44 44 45 //this->setSize2D( … … 184 185 if (State::getPlayer() && State::getPlayer()->getPlayable() && State::getObjectManager()) 185 186 { 186 printf("UPDATING RADAR\n");187 PRINTF(4)("UPDATING RADAR\n"); 187 188 this->_radar->setCenterNode(State::getPlayer()->getPlayable()); 188 this->_radar->addEntityList(&State::getObjectManager()->get ObjectList((OM_LIST)(State::getPlayer()->getPlayable()->getOMListNumber()+1)), Color(.4, .4, 1.0));189 this->_radar->addEntityList(&State::getObjectManager()->get ObjectList(OM_GROUP_02), Color(1.0, .2, .2));189 this->_radar->addEntityList(&State::getObjectManager()->getEntityList((OM_LIST)(State::getPlayer()->getPlayable()->getOMListNumber()+1)), Color(.4, .4, 1.0)); 190 this->_radar->addEntityList(&State::getObjectManager()->getEntityList(OM_GROUP_02), Color(1.0, .2, .2)); 190 191 this->_radar->setAbsCoor2D(0.8 * this->resX, 0.01 * this->resY); 191 192 this->_radar->setWidgetSize(0.2 * this->resX, 0.2 * this->resY); -
trunk/src/util/hud.h
r8995 r9869 23 23 class Hud : public Element2D, public EventListener 24 24 { 25 ObjectListDeclaration(Hud); 25 26 26 27 public: -
trunk/src/util/kill_target.cc
r9406 r9869 22 22 23 23 24 25 CREATE_FACTORY(KillTarget, CL_KILL_TARGET); 24 #include "class_id_DEPRECATED.h" 25 ObjectListDefinitionID(KillTarget, CL_KILL_TARGET); 26 CREATE_FACTORY(KillTarget); 26 27 27 28 … … 32 33 KillTarget::KillTarget (const TiXmlElement* root) 33 34 : MissionGoal(root) { 34 this->setClassID(CL_KILL_TARGET, "KillTarget");35 this->registerObject(this, KillTarget::_objectList); 35 36 36 37 if( root != NULL) -
trunk/src/util/kill_target.h
r7464 r9869 17 17 class KillTarget : public MissionGoal 18 18 { 19 ObjectListDeclaration(KillTarget); 19 20 20 21 public: -
trunk/src/util/mission_goal.cc
r9406 r9869 24 24 25 25 26 26 ObjectListDefinition(MissionGoal); 27 27 /** 28 28 * standard constructor … … 31 31 MissionGoal::MissionGoal (const TiXmlElement* root) 32 32 { 33 this->setClassID(CL_MISSION_GOAL, "MissionGoal");33 this->registerObject(this, MissionGoal::_objectList); 34 34 35 35 this->missionState = MS_PASSIVE; -
trunk/src/util/mission_goal.h
r7464 r9869 26 26 //! A class representing a mission goal 27 27 class MissionGoal : public BaseObject { 28 ObjectListDeclaration(MissionGoal); 28 29 29 30 public: -
trunk/src/util/multiplayer_team_deathmatch.cc
r9656 r9869 24 24 #include "render2D/image_plane.h" 25 25 #include "state.h" 26 #include "class_list.h"27 26 28 27 #include "player.h" … … 33 32 #include "shared_network_data.h" 34 33 #include "terrain.h" 35 #include "class_list.h"36 34 #include "space_ships/space_ship.h" 37 35 … … 50 48 51 49 52 53 54 CREATE_FACTORY(MultiplayerTeamDeathmatch, CL_MULTIPLAYER_TEAM_DEATHMATCH); 55 56 50 #include "class_id_DEPRECATED.h" 51 52 ObjectListDefinitionID(MultiplayerTeamDeathmatch, CL_MULTIPLAYER_TEAM_DEATHMATCH); 53 CREATE_FACTORY(MultiplayerTeamDeathmatch); 57 54 /** 58 55 * constructor 59 56 */ 60 57 MultiplayerTeamDeathmatch::MultiplayerTeamDeathmatch(const TiXmlElement* root) 61 : NetworkGameRules(root)62 { 63 this-> setClassID(CL_MULTIPLAYER_TEAM_DEATHMATCH, "MultiplayerTeamDeathmatch");58 : NetworkGameRules(root) 59 { 60 this->registerObject(this, MultiplayerTeamDeathmatch::_objectList); 64 61 65 62 this->bLocalPlayerDead = false; … … 114 111 115 112 LoadParam(root, "death-penalty-timeout", this, MultiplayerTeamDeathmatch, setDeathPenaltyTimeout) 116 113 .describe("sets the time in seconds a player has to wait for respawn"); 117 114 118 115 LoadParam(root, "max-kills", this, MultiplayerTeamDeathmatch, setMaxKills) 119 116 .describe("sets the maximal kills for winning condition"); 120 117 121 118 LoadParam(root, "num-teams", this, MultiplayerTeamDeathmatch, setNumTeams) 122 119 .describe("sets number of teams"); 123 120 124 121 } … … 192 189 } 193 190 194 // if( PlayerStats::getStats( SharedNetworkData::getInstance()->getHostID() ) )195 // {196 // PRINTF(0)("prefered team id: %i, noteam: %i\n", PlayerStats::getStats( SharedNetworkData::getInstance()->getHostID() )->getPreferedTeamId(), TEAM_NOTEAM);197 // }191 // if( PlayerStats::getStats( SharedNetworkData::getInstance()->getHostID() ) ) 192 // { 193 // PRINTF(0)("prefered team id: %i, noteam: %i\n", PlayerStats::getStats( SharedNetworkData::getInstance()->getHostID() )->getPreferedTeamId(), TEAM_NOTEAM); 194 // } 198 195 199 196 // check if the menu should be removed and the game state should be entered … … 273 270 if( unlikely( this->bLocalPlayerDead)) 274 271 { 275 276 272 } 277 273 } … … 308 304 { 309 305 if ( team == TEAM_NOTEAM || team == TEAM_SPECTATOR ) 310 return CL_SPECTATOR;306 return ObjectListBase::retrieveIdentity("Spectator"); 311 307 312 308 if ( team == 0 || team == 1 ) 313 return CL_TURBINE_HOVER;309 return ObjectListBase::retrieveIdentity("TurbineHover"); 314 310 315 311 assert( false ); … … 317 313 318 314 319 std::string MultiplayerTeamDeathmatch::getPlayableModelFileName( int userId, int team, ClassIDclassId )315 std::string MultiplayerTeamDeathmatch::getPlayableModelFileName( int userId, int team, const ClassID& classId ) 320 316 { 321 317 if (classId == CL_TURBINE_HOVER) 322 return "models/ships/hoverglider_mainbody.obj";318 return "models/ships/hoverglider_mainbody.obj"; 323 319 if ( team == 0 ) 324 320 return "models/creatures/doom_guy.md2"; … … 329 325 } 330 326 331 std::string MultiplayerTeamDeathmatch::getPlayableModelTextureFileName( int userId, int team, ClassIDclassId )327 std::string MultiplayerTeamDeathmatch::getPlayableModelTextureFileName( int userId, int team, const ClassID& classId ) 332 328 { 333 329 if ( classId == CL_FPS_PLAYER ) … … 342 338 } 343 339 344 float MultiplayerTeamDeathmatch::getPlayableScale( int userId, int team, ClassIDclassId )345 { 346 if ( classId == CL_FPS_PLAYER)340 float MultiplayerTeamDeathmatch::getPlayableScale( int userId, int team, const ClassID& classId ) 341 { 342 if ( classId == ObjectListBase::retrieveIdentity(CL_FPS_PLAYER)) 347 343 { 348 344 return 10.0f; … … 362 358 teamScore[i] = 0; 363 359 364 365 const std::list<BaseObject*> * list = ClassList::getList( CL_PLAYER_STATS ); 366 367 if ( !list ) 368 return; 369 370 for ( std::list<BaseObject*>::const_iterator it = list->begin(); it != list->end(); it++ ) 371 { 372 PlayerStats & stats = *dynamic_cast<PlayerStats*>(*it); 360 for (ObjectList<PlayerStats>::const_iterator it = PlayerStats::objectList().begin(); 361 it != PlayerStats::objectList().end(); 362 ++it) 363 { 364 PlayerStats & stats = *(*it); 373 365 374 366 if ( stats.getTeamId() >= 0 ) … … 390 382 playersInTeam[i] = 0; 391 383 392 const std::list<BaseObject*> * list = ClassList::getList( CL_PLAYER_STATS ); 393 394 if ( !list ) 395 return 0; 396 397 for ( std::list<BaseObject*>::const_iterator it = list->begin(); it != list->end(); it++ ) 398 { 399 PlayerStats & stats = *dynamic_cast<PlayerStats*>(*it); 384 for (ObjectList<PlayerStats>::const_iterator it = PlayerStats::objectList().begin(); 385 it != PlayerStats::objectList().end(); 386 ++it) 387 { 388 PlayerStats & stats = *(*it); 400 389 401 390 if ( stats.getTeamId() >= 0 ) … … 453 442 void MultiplayerTeamDeathmatch::handleTeamChanges( ) 454 443 { 455 const std::list<BaseObject*> * list = ClassList::getList( CL_PLAYER_STATS ); 456 457 if ( !list ) 458 return; 459 460 //first server players with choices 461 for ( std::list<BaseObject*>::const_iterator it = list->begin(); it != list->end(); it++ ) 462 { 463 PlayerStats & stats = *dynamic_cast<PlayerStats*>(*it); 444 for (ObjectList<PlayerStats>::const_iterator it = PlayerStats::objectList().begin(); 445 it != PlayerStats::objectList().end(); 446 ++it) 447 { 448 PlayerStats & stats = *(*it); 464 449 465 450 if ( stats.getTeamId() != stats.getPreferedTeamId() ) … … 473 458 474 459 //now serve player who want join a random team 475 for ( std::list<BaseObject*>::const_iterator it = list->begin(); it != list->end(); it++ ) 476 { 477 PlayerStats & stats = *dynamic_cast<PlayerStats*>(*it); 460 for (ObjectList<PlayerStats>::const_iterator it = PlayerStats::objectList().begin(); 461 it != PlayerStats::objectList().end(); 462 ++it) 463 { 464 PlayerStats & stats = *(*it); 478 465 479 466 if ( stats.getTeamId() != stats.getPreferedTeamId() ) … … 587 574 if ( event.bPressed ) 588 575 this->bShowTeamChange = true; 589 } else if ( event.type == SDLK_F1 ) 576 } 577 else if ( event.type == SDLK_F1 ) 590 578 { 591 579 if ( this->statsBox && !this->bLocalPlayerDead && event.bPressed ) … … 683 671 void MultiplayerTeamDeathmatch::hideStats( ) 684 672 { 685 686 687 688 689 673 if ( statsBox ) 674 { 675 delete statsBox; 676 statsBox = NULL; 677 } 690 678 } 691 679 … … 822 810 void MultiplayerTeamDeathmatch::respawnPlayable( Playable * playable, int teamId, float delay ) 823 811 { 824 const std::list<BaseObject*> * list = ClassList::getList( CL_SPAWNING_POINT );825 826 assert( list );827 812 828 813 std::vector<SpawningPoint*> spList; 829 814 830 for ( std::list<BaseObject*>::const_iterator it = list->begin(); it != list->end(); it++ ) 831 { 832 SpawningPoint * sp = dynamic_cast<SpawningPoint*>(*it); 815 for (ObjectList<SpawningPoint>::const_iterator it = SpawningPoint::objectList().begin(); 816 it != SpawningPoint::objectList().end(); 817 ++it) 818 { 819 SpawningPoint * sp = (*it); 833 820 834 821 if ( sp->getTeamId() == teamId ) … … 838 825 if ( spList.size() == 0 ) 839 826 { 840 for ( std::list<BaseObject*>::const_iterator it = list->begin(); it != list->end(); it++ ) 841 { 842 SpawningPoint * sp = dynamic_cast<SpawningPoint*>(*it); 827 for (ObjectList<SpawningPoint>::const_iterator it = SpawningPoint::objectList().begin(); 828 it != SpawningPoint::objectList().end(); 829 ++it) 830 { 831 SpawningPoint * sp = (*it); 843 832 844 833 if ( sp->getTeamId() < 0 ) -
trunk/src/util/multiplayer_team_deathmatch.h
r9235 r9869 30 30 class MultiplayerTeamDeathmatch : public NetworkGameRules, public EventListener 31 31 { 32 ObjectListDeclaration(MultiplayerTeamDeathmatch); 32 33 33 34 public: … … 39 40 virtual int getTeamForNewUser(); 40 41 virtual ClassID getPlayableClassId( int userId, int team ); 41 virtual std::string getPlayableModelTextureFileName( int userId, int team, ClassIDclassId );42 virtual std::string getPlayableModelFileName( int userId, int team, ClassIDclassId );43 virtual float getPlayableScale( int userId, int team, ClassIDclassId );42 virtual std::string getPlayableModelTextureFileName( int userId, int team, const ClassID& classId ); 43 virtual std::string getPlayableModelFileName( int userId, int team, const ClassID& classId ); 44 virtual float getPlayableScale( int userId, int team, const ClassID& classId ); 44 45 45 46 virtual void registerSpawn( WorldEntity * we ); … … 50 51 inline void setDeathPenaltyTimeout(float time) { this->deathTimeout = time; } 51 52 inline void setMaxKills(int kills) { this->maxKills = kills; } 52 53 53 54 inline void setNumTeams( int numTeams ){ this->numTeams = numTeams; } 54 55 inline int getNumTeams(){ return this->numTeams; } 55 56 56 57 int getRandomTeam(); 57 58 58 59 virtual void process(const Event &event); 59 60 60 61 void onKill( WorldEntity * victim, WorldEntity * killer ); 61 62 void onRespawn( int userId ); 62 63 63 64 virtual void handleChatMessage( int userId, const std::string & message, int messageType ); 64 65 65 66 void respawnPlayable( Playable * playable, int teamId, float delay ); 66 67 … … 84 85 85 86 OrxGui::GLGuiBox* box; 86 87 87 88 OrxGui::GLGuiInputLine* input; 88 89 89 90 void calculateTeamScore(); 90 91 void nextGameState(); … … 92 93 void teamChange( int userId ); 93 94 void assignPlayable(); 94 95 95 96 void onButtonSpectator(); 96 97 void onButtonRandom(); … … 99 100 void onButtonCancel(); 100 101 void onButtonExit(); 101 102 102 103 void onInputEnter( const std::string & text ); 103 104 104 105 OrxGui::GLGuiBox* statsBox; 105 106 OrxGui::GLGuiTable* table; 106 107 void tickStatsTable(); 107 108 108 109 void showStats(); 109 110 void hideStats(); -
trunk/src/util/network_game_rules.cc
r9406 r9869 22 22 23 23 24 ObjectListDefinition(NetworkGameRules); 24 25 25 26 /** … … 27 28 */ 28 29 NetworkGameRules::NetworkGameRules ( const TiXmlElement* root ) 29 : GameRules( root )30 : GameRules( root ) 30 31 { 31 this-> setClassID( CL_NETWORK_GAME_RULES, "NetworkGameRules");32 this->registerObject(this, NetworkGameRules::_objectList); 32 33 } 33 34 … … 37 38 */ 38 39 NetworkGameRules::~NetworkGameRules () 39 { 40 } 40 {} 41 41 42 42 43 std::string NetworkGameRules::getPlayableModelTextureFileName( int userId, int team, ClassIDclassId )43 std::string NetworkGameRules::getPlayableModelTextureFileName( int userId, int team, const ClassID& classId ) 44 44 { 45 45 return ""; 46 46 } 47 47 48 std::string NetworkGameRules::getPlayableModelFileName( int uesrId, int team, ClassIDclassId )48 std::string NetworkGameRules::getPlayableModelFileName( int uesrId, int team, const ClassID& classId ) 49 49 { 50 50 return "models/ships/reap_#.obj"; … … 53 53 ClassID NetworkGameRules::getPlayableClassId( int userId, int team ) 54 54 { 55 return CL_SPACE_SHIP; 55 const ObjectListBase* objList = ObjectListBase::getObjectList("SpaceShip"); 56 if (objList != NULL) 57 return objList->identity(); 58 else 59 return ClassID(); 56 60 } 57 61 … … 68 72 69 73 70 float NetworkGameRules::getPlayableScale( int userId, int team, ClassIDclassId )74 float NetworkGameRules::getPlayableScale( int userId, int team, const ClassID& classId ) 71 75 { 72 76 return 1.0f; -
trunk/src/util/network_game_rules.h
r9235 r9869 15 15 class NetworkGameRules : public GameRules 16 16 { 17 ObjectListDeclaration(NetworkGameRules); 17 18 18 19 public: 19 20 NetworkGameRules( const TiXmlElement* root ); 20 21 virtual ~NetworkGameRules(); 21 22 22 23 virtual int getTeamForNewUser(); 23 24 virtual ClassID getPlayableClassId( int userId, int team ); 24 virtual std::string getPlayableModelFileName( int userId, int team, ClassIDclassId );25 virtual std::string getPlayableModelTextureFileName( int userId, int team, ClassIDclassId );26 virtual float getPlayableScale( int userId, int team, ClassIDclassId );27 25 virtual std::string getPlayableModelFileName( int userId, int team, const ClassID& classId ); 26 virtual std::string getPlayableModelTextureFileName( int userId, int team, const ClassID& classId ); 27 virtual float getPlayableScale( int userId, int team, const ClassID& classId ); 28 28 29 virtual PlayerStats * getNewPlayerStats( int userId ){ return new PlayerStats( userId ); } 29 30 30 31 virtual void handleChatMessage( int userId, const std::string & message, int messageType ) = 0; 31 32 32 33 void shellSay( const std::string & message ); 33 34 -
trunk/src/util/object_manager.cc
r9656 r9869 17 17 18 18 #include "object_manager.h" 19 #include "class_list.h"20 19 21 20 #include "world_entity.h" … … 30 29 ->defaultValues("", 0); 31 30 31 ObjectListDefinition(ObjectManager); 32 32 /** 33 33 * @brief standard constructor … … 35 35 ObjectManager::ObjectManager () 36 36 { 37 this->setClassID(CL_OBJECT_MANAGER, "ObjectManager");37 this->registerObject(this, ObjectManager::_objectList); 38 38 this->setName("ObjectManager"); 39 39 … … 63 63 { 64 64 for (unsigned int i = 0; i < OM_SIZE; ++i) 65 while(!this-> objectLists[i].empty())66 delete this-> objectLists[i].front();65 while(!this->entityLists[i].empty()) 66 delete this->entityLists[i].front(); 67 67 68 68 // delete reflection list … … 83 83 84 84 if (likely(entity->getOMListNumber() != OM_INIT)) 85 this-> objectLists[entity->getOMListNumber()].erase(entity->getEntityIterator());85 this->entityLists[entity->getOMListNumber()].erase(entity->getEntityIterator()); 86 86 87 87 if (likely(omList != OM_INIT)) 88 88 { 89 this-> objectLists[omList].push_back(entity);90 entity->getEntityIterator() = --this-> objectLists[omList].end();89 this->entityLists[omList].push_back(entity); 90 entity->getEntityIterator() = --this->entityLists[omList].end(); 91 91 entity->getOMListNumber() = omList; 92 92 } … … 111 111 * @returns a new List with a list of WorldEntities of distance Radius from center 112 112 */ 113 void ObjectManager::distanceFromObject(EntityList& entities, const PNode& center, float radius, ClassID classID) 114 { 115 const std::list<BaseObject*>* objectList = ClassList::getList(classID); 116 if (objectList != NULL) 113 /* 114 void ObjectManager::distanceFromObject(EntityList& entities, const PNode& center, float radius, const ClassID& classID) 115 { 116 TODO FIXME 117 118 const std::list<BaseObject*>* entityList = ClassList::getList(classID); 119 if (entityList != NULL) 117 120 { 118 121 119 122 std::list<BaseObject*>::const_iterator node; 120 for (node = objectList->begin(); node != objectList->end(); node++)123 for (node = entityList->begin(); node != entityList->end(); node++) 121 124 if ((dynamic_cast<PNode*>(*node)->getAbsCoor() - center.getAbsCoor()).len() < radius) 122 125 entities.push_back(dynamic_cast<WorldEntity*>(*node)); 123 126 } 124 127 } 128 */ 125 129 126 130 … … 134 138 if (omList != OM_INIT || omList == OM_SIZE) 135 139 { 136 PRINT(0)(" +ObjectManager-LIST: '%s'==size='%d'==---\n", ObjectManager::OMListToString((OM_LIST)omList).c_str(), this-> objectLists[omList].size());140 PRINT(0)(" +ObjectManager-LIST: '%s'==size='%d'==---\n", ObjectManager::OMListToString((OM_LIST)omList).c_str(), this->entityLists[omList].size()); 137 141 // if (level >= 1) 138 142 { 139 143 ObjectManager::EntityList::const_iterator entity; 140 for (entity = this-> objectLists[omList].begin(); entity != this->objectLists[omList].end(); entity++)144 for (entity = this->entityLists[omList].begin(); entity != this->entityLists[omList].end(); entity++) 141 145 { 142 146 PRINT(0)(" | %s::%s\n",(*entity)->getClassCName(), (*entity)->getCName()); -
trunk/src/util/object_manager.h
r9656 r9869 73 73 class ObjectManager : public BaseObject 74 74 { 75 ObjectListDeclaration(ObjectManager); 75 76 public: 76 77 typedef std::list<WorldEntity*> EntityList; //!< A type definition to make it easy to use EntityLists. … … 86 87 87 88 /** @returns the List (listnumber) of objects. @param listNumber the List to get. */ 88 EntityList& get ObjectList(OM_LIST listNumber) { return this->objectLists[listNumber]; }89 EntityList& getEntityList(OM_LIST listNumber) { return this->entityLists[listNumber]; } 89 90 /** @returns a constant LIST of Objects. @param listNumber the objectList to returns */ 90 const EntityList& get ObjectList(OM_LIST listNumber) const { return this->objectLists[listNumber]; }91 const EntityList& getEntityList(OM_LIST listNumber) const { return this->entityLists[listNumber]; } 91 92 92 static void distanceFromObject(EntityList& entities, const PNode& center, float radius, ClassID classID);93 template <class T> static void distanceFromObject(EntityList& entities, const PNode& center, float radius, ObjectList<T>& list); 93 94 94 95 void debug(OM_LIST omList, unsigned int level = 0) const; … … 111 112 const std::list<BaseObject>* pNodeList; //!< The List of PNodes. 112 113 113 EntityList objectLists[OM_SIZE]; //!< The ObjectLists.114 EntityList entityLists[OM_SIZE]; //!< The ObjectLists. 114 115 115 116 static const std::string objectManagerListNames[]; //!< Names of all the lists -
trunk/src/util/singleplayer_shootemup.cc
r9406 r9869 25 25 26 26 27 28 CREATE_FACTORY(SingleplayerShootemup, CL_SINGLEPLAYER_SHOOTEMUP); 29 30 27 #include "class_id_DEPRECATED.h" 28 ObjectListDefinitionID(SingleplayerShootemup, CL_SINGLEPLAYER_SHOOTEMUP); 29 CREATE_FACTORY(SingleplayerShootemup); 31 30 32 31 /** … … 36 35 : GameRules(root) 37 36 { 38 this-> setClassID(CL_SINGLEPLAYER_SHOOTEMUP, "SingleplayerShootemup");37 this->registerObject(this, SingleplayerShootemup::_objectList); 39 38 40 39 if( root != NULL) -
trunk/src/util/singleplayer_shootemup.h
r7464 r9869 18 18 class SingleplayerShootemup : public GameRules 19 19 { 20 20 ObjectListDeclaration(SingleplayerShootemup); 21 21 public: 22 22 SingleplayerShootemup(const TiXmlElement* root = NULL); -
trunk/src/util/track/pilot_node.cc
r7868 r9869 24 24 25 25 26 ObjectListDefinition(PilotNode); 26 27 /** 27 28 * standard constructor … … 29 30 PilotNode::PilotNode () 30 31 { 31 this->setClassID(CL_PILOT_PARENT, "PilotNode");32 this->registerObject(this, PilotNode::_objectList); 32 33 this->setName("PilotNode"); 33 34 -
trunk/src/util/track/pilot_node.h
r5039 r9869 15 15 //! The PilotNode is a node that enables the is driven by the Mouse 16 16 class PilotNode : public WorldEntity, public EventListener { 17 ObjectListDeclaration(PilotNode); 17 18 18 19 public: -
trunk/src/util/track/track_node.cc
r9406 r9869 22 22 23 23 24 24 ObjectListDefinition(TracNode); 25 25 /** 26 26 * standard constructor … … 28 28 TrackNode::TrackNode () 29 29 { 30 this-> setClassID(CL_TRACK_NODE, "TrackNode");30 this->registerObject(this, TracNode::_objectList); 31 31 this->setName("TrackNode"); 32 32 -
trunk/src/util/track/track_node.h
r5405 r9869 1 /*! 1 /*! 2 2 * @file track_node.h 3 3 * Definition of the TrackNode are located here 4 5 the TrackNode is the node, that follows the Track (and the TrackManager) 4 5 the TrackNode is the node, that follows the Track (and the TrackManager) 6 6 through the level. 7 Under normal confitions the Plyaer(s) are 7 Under normal confitions the Plyaer(s) are 8 8 */ 9 9 … … 18 18 19 19 //! A node that follows the track. 20 class TrackNode : public PNode 20 class TrackNode : public PNode 21 21 { 22 22 ObjectListDeclaratrion(TracNode); 23 23 public: 24 24 TrackNode ();
Note: See TracChangeset
for help on using the changeset viewer.