Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9709 in orxonox.OLD for branches/new_class_id/src/story_entities


Ignore:
Timestamp:
Aug 31, 2006, 10:51:08 PM (18 years ago)
Author:
bensch
Message:

orxonox/branches/new_class_id: new_class ID working, adapdet many classes, and reinvented some of the ClassID stuff

Location:
branches/new_class_id/src/story_entities
Files:
20 edited

Legend:

Unmodified
Added
Removed
  • branches/new_class_id/src/story_entities/campaign.cc

    r9406 r9709  
    2727
    2828
     29NewObjectListDefinition(Campaign);
    2930
    3031/**
     
    3637Campaign::Campaign ( TiXmlElement* root)
    3738{
    38   this->setClassID(CL_CAMPAIGN, "Campaign");
     39  this->registerObject(this, Campaign::_objectList);
    3940
    4041  PRINTF(4)("Loading Campaign...\n");
  • branches/new_class_id/src/story_entities/campaign.h

    r6874 r9709  
    1818class Campaign : public StoryEntity
    1919{
    20 
     20  NewObjectListDeclaration(Campaign);
    2121  public:
    2222    Campaign( TiXmlElement* root);
  • branches/new_class_id/src/story_entities/campaign_data.cc

    r9406 r9709  
    2525
    2626
     27NewObjectListDefinition(CampaignData);
    2728
    2829/**
     
    3132CampaignData::CampaignData(const TiXmlElement* root)
    3233{
    33   this->setClassID(CL_CAMPAIGN_DATA, "CampaignData");
     34  this->registerObject(this, CampaignData::_objectList);
    3435
    3536  this->currentEntity = NULL;
  • branches/new_class_id/src/story_entities/campaign_data.h

    r7370 r9709  
    1616class CampaignData : public DataTank
    1717{
     18  NewObjectListDeclaration(CampaignData);
    1819
    1920public:
  • branches/new_class_id/src/story_entities/dedicated_server_world.cc

    r9406 r9709  
    2121
    2222#include "util/loading/load_param.h"
    23 #include "fast_factory.h"
     23#include "loading/fast_factory.h"
    2424#include "util/loading/factory.h"
    2525
  • branches/new_class_id/src/story_entities/game_world.cc

    r9494 r9709  
    2222#include "util/loading/resource_manager.h"
    2323#include "state.h"
    24 #include "class_list.h"
    2524
    2625#include "util/loading/game_loader.h"
     
    4039#include "util/loading/factory.h"
    4140#include "util/loading/load_param.h"
    42 #include "fast_factory.h"
     41#include "loading/fast_factory.h"
    4342#include "shell_command.h"
    4443
     
    6362
    6463#include "script_class.h"
    65 CREATE_SCRIPTABLE_CLASS(GameWorld, CL_GAME_WORLD,
     64NewObjectListDefinition(GameWorld);
     65CREATE_SCRIPTABLE_CLASS(GameWorld, GameWorld::classID(),
    6666                        addMethod("setPlaymode", ExecutorLua1<GameWorld,const std::string&>(&GameWorld::setPlaymode))
    6767                        ->addMethod("setSoundtrack", ExecutorLua1<GameWorld, const std::string&>(&GameWorld::setSoundtrack))
     
    7777
    7878
    79 
    8079GameWorld::GameWorld()
    8180    : StoryEntity()
    8281{
    83   this->setClassID(CL_GAME_WORLD, "GameWorld");
     82  this->registerObject(this, GameWorld::_objectList);
    8483  this->setName("Preloaded World - no name yet");
    8584
     
    432431    // TICK everything
    433432    for (i = 0; i < this->dataTank->tickLists.size(); ++i)
    434       this->tick(this->dataTank->objectManager->getObjectList(this->dataTank->tickLists[i]), this->dtS);
     433      this->tick(this->dataTank->objectManager->getEntityList(this->dataTank->tickLists[i]), this->dtS);
    435434
    436435    /* update tick the rest */
     
    471470{
    472471  // object-object collision detection
    473   CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_GROUP_00),
    474       this->dataTank->objectManager->getObjectList(OM_GROUP_01_PROJ));
    475   CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_GROUP_01),
    476       this->dataTank->objectManager->getObjectList(OM_GROUP_00_PROJ));
    477   CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_GROUP_01),
    478       this->dataTank->objectManager->getObjectList(OM_GROUP_00));
    479 
    480   CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_GROUP_01),
    481       this->dataTank->objectManager->getObjectList(OM_GROUP_02));
    482   CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_GROUP_02),
    483       this->dataTank->objectManager->getObjectList(OM_GROUP_01_PROJ));
    484 
    485 
    486   CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_GROUP_00),
    487       this->dataTank->objectManager->getObjectList(OM_COMMON));
    488   CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_GROUP_01),
    489       this->dataTank->objectManager->getObjectList(OM_COMMON));
     472  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_GROUP_00),
     473      this->dataTank->objectManager->getEntityList(OM_GROUP_01_PROJ));
     474  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_GROUP_01),
     475      this->dataTank->objectManager->getEntityList(OM_GROUP_00_PROJ));
     476  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_GROUP_01),
     477      this->dataTank->objectManager->getEntityList(OM_GROUP_00));
     478
     479  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_GROUP_01),
     480      this->dataTank->objectManager->getEntityList(OM_GROUP_02));
     481  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_GROUP_02),
     482      this->dataTank->objectManager->getEntityList(OM_GROUP_01_PROJ));
     483
     484
     485  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_GROUP_00),
     486      this->dataTank->objectManager->getEntityList(OM_COMMON));
     487  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_GROUP_01),
     488      this->dataTank->objectManager->getEntityList(OM_COMMON));
    490489
    491490  // ground collision detection: BSP Model
    492   CDEngine::getInstance()->checkCollisionGround(this->dataTank->objectManager->getObjectList(OM_GROUP_00));
    493   CDEngine::getInstance()->checkCollisionGround(this->dataTank->objectManager->getObjectList(OM_GROUP_01));
     491  CDEngine::getInstance()->checkCollisionGround(this->dataTank->objectManager->getEntityList(OM_GROUP_00));
     492  CDEngine::getInstance()->checkCollisionGround(this->dataTank->objectManager->getEntityList(OM_GROUP_01));
    494493}
    495494
     
    567566  //  glLoadIdentity();
    568567
    569   const std::list<BaseObject*>* reflectedWaters;
    570568  MappedWater* mw;
    571569
    572   if( (reflectedWaters = ClassList::getList(CL_MAPPED_WATER)) != NULL)
    573   {
    574     std::list<BaseObject*>::const_iterator it;
    575     for (it = reflectedWaters->begin(); it != reflectedWaters->end(); it++)
    576     {
    577       mw =  dynamic_cast<MappedWater*>(*it);
    578 
    579       //camera and light
    580       //this->dataTank->localCamera->apply ();
    581       //this->dataTank->localCamera->project ();
    582 
    583       LightManager::getInstance()->draw();
    584 
    585 
    586       // prepare for reflection rendering
    587       mw->activateReflection();
    588 
    589       // draw everything to be included in the reflection
    590       this->drawEntityList(State::getObjectManager()->getReflectionList());
    591       //       for (unsigned int i = 0; i < this->dataTank->drawLists.size(); ++i)
    592       //         this->drawEntityList(State::getObjectManager()->getObjectList(this->dataTank->drawLists[i]));
    593 
    594       // clean up from reflection rendering
    595       mw->deactivateReflection();
    596     }
     570  for (NewObjectList<MappedWater>::const_iterator it = MappedWater::objectList().begin();
     571       it != MappedWater::objectList().end();
     572       ++it)
     573  {
     574    mw =  (*it);
     575
     576    //camera and light
     577    //this->dataTank->localCamera->apply ();
     578    //this->dataTank->localCamera->project ();
     579
     580    LightManager::getInstance()->draw();
     581
     582
     583    // prepare for reflection rendering
     584    mw->activateReflection();
     585
     586    // draw everything to be included in the reflection
     587    this->drawEntityList(State::getObjectManager()->getReflectionList());
     588    //       for (unsigned int i = 0; i < this->dataTank->drawLists.size(); ++i)
     589    //         this->drawEntityList(State::getObjectManager()->getEntityList(this->dataTank->drawLists[i]));
     590
     591    // clean up from reflection rendering
     592    mw->deactivateReflection();
    597593  }
    598594
     
    609605  //glLoadIdentity();
    610606
    611   const std::list<BaseObject*>* reflectedWaters;
    612607  MappedWater* mw;
    613608
    614   if( (reflectedWaters = ClassList::getList(CL_MAPPED_WATER)) != NULL)
    615   {
    616     std::list<BaseObject*>::const_iterator it;
    617     for (it = reflectedWaters->begin(); it != reflectedWaters->end(); it++)
    618     {
    619       mw =  dynamic_cast<MappedWater*>(*it);
    620 
    621       //camera and light
    622       //this->dataTank->localCamera->apply ();
    623       //this->dataTank->localCamera->project ();
    624       // prepare for reflection rendering
    625       mw->activateRefraction();
    626 
    627 
    628       LightManager::getInstance()->draw();
    629       // draw everything to be included in the reflection
    630       this->drawEntityList(State::getObjectManager()->getReflectionList());
    631       //       for (unsigned int i = 0; i < this->dataTank->drawLists.size(); ++i)
    632       //         this->drawEntityList(State::getObjectManager()->getObjectList(this->dataTank->drawLists[i]));
    633 
    634       // clean up from reflection rendering
    635       mw->deactivateRefraction();
    636     }
     609  for (NewObjectList<MappedWater>::const_iterator it = MappedWater::objectList().begin();
     610       it != MappedWater::objectList().end();
     611       ++it)
     612  {
     613    mw =  dynamic_cast<MappedWater*>(*it);
     614
     615    //camera and light
     616    //this->dataTank->localCamera->apply ();
     617    //this->dataTank->localCamera->project ();
     618    // prepare for reflection rendering
     619    mw->activateRefraction();
     620
     621
     622    LightManager::getInstance()->draw();
     623    // draw everything to be included in the reflection
     624    this->drawEntityList(State::getObjectManager()->getReflectionList());
     625    //       for (unsigned int i = 0; i < this->dataTank->drawLists.size(); ++i)
     626    //         this->drawEntityList(State::getObjectManager()->getEntityList(this->dataTank->drawLists[i]));
     627
     628    // clean up from reflection rendering
     629    mw->deactivateRefraction();
    637630  }
    638631}
     
    659652  {
    660653    /* Draw the BackGround */
    661     this->drawEntityList(State::getObjectManager()->getObjectList(OM_BACKGROUND));
     654    this->drawEntityList(State::getObjectManager()->getEntityList(OM_BACKGROUND));
    662655    engine->drawBackgroundElements();
    663656
    664657    /* draw all WorldEntiy groups */
    665658    for (unsigned int i = 0; i < this->dataTank->drawLists.size(); ++i)
    666       this->drawEntityList(State::getObjectManager()->getObjectList(this->dataTank->drawLists[i]));
     659      this->drawEntityList(State::getObjectManager()->getEntityList(this->dataTank->drawLists[i]));
    667660
    668661    AtmosphericEngine::getInstance()->draw();
     
    672665      CDEngine* engine = CDEngine::getInstance();
    673666      for (unsigned int i = 0; i < this->dataTank->drawLists.size(); ++i)
    674         engine->drawBV(State::getObjectManager()->getObjectList(this->dataTank->drawLists[i]), this->showBVLevel);
     667        engine->drawBV(State::getObjectManager()->getEntityList(this->dataTank->drawLists[i]), this->showBVLevel);
    675668    }
    676669
  • branches/new_class_id/src/story_entities/game_world.h

    r9235 r9709  
    3131class GameWorld : public StoryEntity
    3232{
     33  NewObjectListDeclaration(GameWorld);
     34
    3335public:
    3436  GameWorld ();
  • branches/new_class_id/src/story_entities/game_world_data.cc

    r9406 r9709  
    2323#include "util/loading/resource_manager.h"
    2424#include "state.h"
    25 #include "class_list.h"
    2625#include "substring.h"
    2726
     
    4140
    4241#include "util/loading/factory.h"
    43 #include "fast_factory.h"
     42#include "loading/fast_factory.h"
    4443#include "util/loading/load_param.h"
    4544
    4645#include "graphics_engine.h"
     46#include "effects/graphics_effect.h"
    4747#include "effects/atmospheric_engine.h"
    4848#include "event_handler.h"
     
    6161
    6262
    63 
    64 
    65 
     63NewObjectListDefinition(GameWorldData);
    6664/**
    6765 * constructor of the GameWorldData
     
    6967GameWorldData::GameWorldData()
    7068{
    71   this->setClassID(CL_GAME_WORLD_DATA, "GameWorldData");
     69  this->registerObject(this, GameWorldData::_objectList);
    7270
    7371  this->glmis = NULL;
     
    215213
    216214      //todo do this more elegant
    217       if( element->Value() == "SkyBox" && created->isA(CL_SKYBOX))
     215      if( element->Value() == "SkyBox" && created->isA(SkyBox::classID()))
    218216      {
    219217        this->sky = dynamic_cast<WorldEntity*>(created);
    220218        State::setSkyBox(dynamic_cast<SkyBox*>(this->sky));
    221219      }
    222       if( element->Value() == "Terrain" && created->isA(CL_TERRAIN))
     220      if( element->Value() == "Terrain" && created->isA(Terrain::classID()))
    223221      {
    224222        this->terrain = dynamic_cast<Terrain*>(created);
     
    236234
    237235  Playable* playable;
    238   const std::list<BaseObject*>* playableList = ClassList::getList(CL_PLAYABLE);
    239   if (playableList != NULL && !playableList->empty())
     236  if (!Playable::objectList().empty())
    240237  {
    241238    /// TODO Make this also loadable
    242     playable = dynamic_cast<Playable*>(playableList->front());
    243     this->localPlayer->setPlayable(playable);
     239    this->localPlayer->setPlayable(Playable::objectList().back());
    244240  }
    245241
     
    280276  GraphicsEngine::getInstance()->displayFPS(false);
    281277  // erease everything that is left.
    282   // delete PNode::getNullParent(); // not needed as this is also done in the next step (and also much cleaner)
    283   const std::list<BaseObject*>* nodeList;
    284278  //secondary cleanup of PNodes;
    285   nodeList = ClassList::getList(CL_PARENT_NODE);
    286   if (nodeList != NULL)
    287     while (!nodeList->empty())
    288     {
    289       //    ClassList::debug( 3, CL_PARENT_NODE);
    290       //    PNode::getNullParent()->debugNode(0);
    291       //    printf("%s::%s\n", nodeList->front()->getClassCName(), nodeList->front()->getName());
    292       delete nodeList->front();
    293     }
     279  while (!PNode::objectList().empty())
     280    delete PNode::objectList().front();
     281
    294282  /* remove the player object */
    295283  if( this->localPlayer)
     
    302290  this->terrain = NULL;
    303291
    304   nodeList = ClassList::getList(CL_GRAPHICS_EFFECT);
    305   if (nodeList != NULL)
    306     while (!nodeList->empty())
    307       delete nodeList->front();
    308 
    309 
    310   nodeList = ClassList::getList(CL_ELEMENT_2D);
    311   if (nodeList != NULL)
    312     while (!nodeList->empty())
    313       delete nodeList->front();
     292  while (!GraphicsEffect::objectList().empty())
     293    delete GraphicsEffect::objectList().front();
     294
     295
     296  while (!Element2D::objectList().empty())
     297    delete Element2D::objectList().front();
    314298
    315299  // At this Point all the WorldEntites should be unloaded.
     
    414398    PRINTF(2)("creating %s\n", element->Value());
    415399    BaseObject* created = Factory::fabricate(element);
    416     if (created != NULL && created->isA(CL_GAME_RULES))
     400    if (created != NULL && created->isA(GameRules::classID()))
    417401    {
    418402      this->gameRule = dynamic_cast<GameRules*>(created);
  • branches/new_class_id/src/story_entities/game_world_data.h

    r9406 r9709  
    3030class GameWorldData : public DataTank
    3131{
     32  NewObjectListDeclaration(GameWorldData);
    3233  public:
    3334    GameWorldData();
  • branches/new_class_id/src/story_entities/menu/game_menu.cc

    r9656 r9709  
    2222
    2323#include "state.h"
    24 #include "class_list.h"
    2524
    2625#include "util/loading/load_param.h"
     
    4342#include "preferences.h"
    4443
     44#include "class_id.h"
    4545//! This creates a Factory to fabricate a GameMenu
    46 CREATE_FACTORY(GameMenu, CL_GAME_MENU);
    47 
     46NewObjectListDefinitionID(GameMenu, CL_GAME_MENU);
     47CREATE_FACTORY(GameMenu);
    4848
    4949
     
    5151    : GameWorld()
    5252{
    53   this->setClassID(CL_GAME_MENU, "GameMenu");
     53  this->registerObject(this, GameMenu::_objectList);
    5454  this->setName("GameMenu uninitialized");
    5555
     
    191191      image->setForegroundColor(Color( 1,1,1,.6));
    192192
    193       const std::list<BaseObject*>* storyEntities = ClassList::getList(CL_STORY_ENTITY);
    194       std::list<BaseObject*>::const_iterator it;
    195193      bool first = true;
    196       for( it = storyEntities->begin(); it != storyEntities->end(); it++)
     194      for(NewObjectList<StoryEntity>::const_iterator it = StoryEntity::objectList().begin();
     195          it != StoryEntity::objectList().end();
     196          ++it)
    197197      {
    198         StoryEntity* se = dynamic_cast<StoryEntity*>(*it);
     198        StoryEntity* se = *it;
    199199        if( se->isContainedInMenu())
    200200        {
  • branches/new_class_id/src/story_entities/menu/game_menu.h

    r9406 r9709  
    2222class GameMenu : virtual public GameWorld, virtual public EventListener
    2323{
    24 
     24  NewObjectListDeclaration(GameMenu);
    2525  public:
    2626    GameMenu(const TiXmlElement* root = NULL);
     
    4545    void showMultiPlayer();
    4646    void showOptionsMenu();
    47    
     47
    4848    void showClientMenu();
    4949    void connectToServer();
    50    
     50
    5151    void showServerMenu();
    5252    void createMasterServer();
     
    6969    void setSelectorSound(const std::string& selectorSound);
    7070
    71    
     71
    7272
    7373
     
    7676    OrxGui::GLGuiBox*                 levelsBox;
    7777    OrxGui::GLGuiBox*                 networkBox;
    78    
     78
    7979    OrxGui::GLGuiBox*                 clientNetworkBox;
    8080    OrxGui::GLGuiInputLine*           ipInputLine;
    81    
     81
    8282    OrxGui::GLGuiBox*                 serverNetworkBox;
    8383
  • branches/new_class_id/src/story_entities/movie_loader.cc

    r9406 r9709  
    2525
    2626
    27 
    28 CREATE_FACTORY(MovieLoader, CL_MOVIE_LOADER);
     27#include "class_id.h"
     28NewObjectListDefinitionID(MovieLoader, CL_MOVIE_LOADER);
     29CREATE_FACTORY(MovieLoader);
    2930
    3031MovieLoader::MovieLoader(const TiXmlElement* root)
    3132{
    32   this->setClassID(CL_MOVIE_LOADER, "MovieLoader");
     33  this->registerObject(this, MovieLoader::_objectList);
    3334
    3435  movie_player = new MoviePlayer();
  • branches/new_class_id/src/story_entities/movie_loader.h

    r7221 r9709  
    1515class MovieLoader : public StoryEntity, virtual public EventListener
    1616{
     17  NewObjectListDeclaration(MovieLoader);
    1718  private:
    1819    MoviePlayer* movie_player;
  • branches/new_class_id/src/story_entities/multi_player_world.cc

    r9656 r9709  
    3636SHELL_COMMAND(debug, MultiPlayerWorld, debug);
    3737
    38 
     38#include "class_id.h"
    3939//! This creates a Factory to fabricate a MultiPlayerWorld
    40 CREATE_FACTORY(MultiPlayerWorld, CL_MULTI_PLAYER_WORLD);
    41 
     40NewObjectListDefinitionID(MultiPlayerWorld, CL_MULTI_PLAYER_WORLD);
     41CREATE_FACTORY(MultiPlayerWorld);
    4242
    4343MultiPlayerWorld::MultiPlayerWorld(const TiXmlElement* root)
    4444  : GameWorld()
    4545{
    46   this->setClassID(CL_MULTI_PLAYER_WORLD, "MultiPlayerWorld");
     46  this->registerObject(this, MultiPlayerWorld::_objectList);
    4747
    4848  this->dataTank = new MultiPlayerWorldData();
     
    9595void MultiPlayerWorld::collisionDetection()
    9696{
    97   //CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_PLAYERS), this->dataTank->objectManager->getObjectList(OM_PLAYERS));
     97  //CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_PLAYERS), this->dataTank->objectManager->getEntityList(OM_PLAYERS));
    9898
    9999  PRINTF(5)("\n-----------------------------------------\nchecking OM_PLAYERS vs OM_GROUP_01_PROJ\n\n");
    100   CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_PLAYERS),
    101     this->dataTank->objectManager->getObjectList(OM_GROUP_00_PROJ));
     100  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_PLAYERS),
     101    this->dataTank->objectManager->getEntityList(OM_GROUP_00_PROJ));
    102102  PRINTF(5)("\n-----------------------------------------\nchecking OM_PLAYERS vs OM_GROUP_01_PROJ\n\n");
    103   CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_PLAYERS),
    104     this->dataTank->objectManager->getObjectList(OM_GROUP_01_PROJ));
     103  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_PLAYERS),
     104    this->dataTank->objectManager->getEntityList(OM_GROUP_01_PROJ));
    105105  PRINTF(5)("\n-----------------------------------------\nchecking OM_PLAYERS vs OM_PLAYERS_PROJ\n\n");
    106   CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_PLAYERS),
    107     this->dataTank->objectManager->getObjectList(OM_PLAYERS_PROJ));
     106  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_PLAYERS),
     107    this->dataTank->objectManager->getEntityList(OM_PLAYERS_PROJ));
    108108
    109   CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_GROUP_00),
    110   this->dataTank->objectManager->getObjectList(OM_PLAYERS));
    111   CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_GROUP_01),
    112   this->dataTank->objectManager->getObjectList(OM_PLAYERS));
     109  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_GROUP_00),
     110  this->dataTank->objectManager->getEntityList(OM_PLAYERS));
     111  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_GROUP_01),
     112  this->dataTank->objectManager->getEntityList(OM_PLAYERS));
    113113
    114114
    115115
    116116  PRINTF(5)("\n-----------------------------------------\nchecking OM_GROUP_00 vs OM_GROUP_01_PROJ\n\n");
    117   CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_GROUP_00),
    118     this->dataTank->objectManager->getObjectList(OM_GROUP_01_PROJ));
     117  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_GROUP_00),
     118    this->dataTank->objectManager->getEntityList(OM_GROUP_01_PROJ));
    119119  PRINTF(5)("\n-----------------------------------------\nchecking OM_GROUP_00 vs OM_GROUP_01\n\n");
    120   CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_GROUP_00),
    121     this->dataTank->objectManager->getObjectList(OM_GROUP_01));
    122   CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_GROUP_00),
    123     this->dataTank->objectManager->getObjectList(OM_PLAYERS_PROJ));
     120  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_GROUP_00),
     121    this->dataTank->objectManager->getEntityList(OM_GROUP_01));
     122  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_GROUP_00),
     123    this->dataTank->objectManager->getEntityList(OM_PLAYERS_PROJ));
    124124
    125125  PRINTF(5)("\n-----------------------------------------\nchecking OM_GROUP_01 vs OM_GROUP_00_PROJ\n\n");
    126   CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_GROUP_01),
    127     this->dataTank->objectManager->getObjectList(OM_GROUP_00_PROJ));
    128   CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_GROUP_01),
    129     this->dataTank->objectManager->getObjectList(OM_GROUP_00));
    130   CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_GROUP_01),
    131     this->dataTank->objectManager->getObjectList(OM_PLAYERS_PROJ));
     126  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_GROUP_01),
     127    this->dataTank->objectManager->getEntityList(OM_GROUP_00_PROJ));
     128  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_GROUP_01),
     129    this->dataTank->objectManager->getEntityList(OM_GROUP_00));
     130  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_GROUP_01),
     131    this->dataTank->objectManager->getEntityList(OM_PLAYERS_PROJ));
    132132
    133133
    134134
    135135    // ground collision detection: BSP Model
    136   CDEngine::getInstance()->checkCollisionGround(this->dataTank->objectManager->getObjectList(OM_GROUP_00));
    137   CDEngine::getInstance()->checkCollisionGround(this->dataTank->objectManager->getObjectList(OM_GROUP_01));
    138   CDEngine::getInstance()->checkCollisionGround(this->dataTank->objectManager->getObjectList(OM_PLAYERS));
     136  CDEngine::getInstance()->checkCollisionGround(this->dataTank->objectManager->getEntityList(OM_GROUP_00));
     137  CDEngine::getInstance()->checkCollisionGround(this->dataTank->objectManager->getEntityList(OM_GROUP_01));
     138  CDEngine::getInstance()->checkCollisionGround(this->dataTank->objectManager->getEntityList(OM_PLAYERS));
    139139}
    140140
  • branches/new_class_id/src/story_entities/multi_player_world.h

    r8228 r9709  
    2020 */
    2121class MultiPlayerWorld : public GameWorld {
    22 
     22  NewObjectListDeclaration(MultiPlayerWorld);
    2323 public:
    2424  MultiPlayerWorld (const TiXmlElement* root = NULL);
     
    2626
    2727  virtual void loadParams(const TiXmlElement* root);
    28  
     28
    2929  virtual ErrorMessage unloadData();
    3030
  • branches/new_class_id/src/story_entities/multi_player_world_data.cc

    r9494 r9709  
    2020#include "util/loading/resource_manager.h"
    2121#include "state.h"
    22 #include "class_list.h"
    2322#include "substring.h"
    2423
     
    4039
    4140#include "util/loading/factory.h"
    42 #include "fast_factory.h"
     41#include "loading/fast_factory.h"
    4342#include "util/loading/load_param.h"
    4443
     
    5049
    5150#include "glmenu_imagescreen.h"
    52 
    53 
    54 
    55 
    5651
    5752
     
    313308{
    314309  PRINT(0)("==================================================\n");
     310
    315311  Playable* playable;
    316   const std::list<BaseObject*>* playableList = ClassList::getList(CL_PLAYABLE);
    317   assert(playableList != NULL);
    318   std::list<BaseObject*>::const_iterator entity;
    319 
    320 
    321 
    322   for (entity = playableList->begin(); entity != playableList->end(); entity++)
    323   {
    324     Playable* p = dynamic_cast<Playable*>(*entity);
     312
     313  for (NewObjectList<Playable>::const_iterator entity = Playable::objectList().begin();
     314       entity != Playable::objectList().end();
     315      ++entity)
     316  {
     317    Playable* p = *entity;
    325318    PRINTF(0)("Got a playable, class: %s, name: %s, uid: %i\n", (*entity)->getClassCName(), (*entity)->getCName(), p->getUniqueID());
    326319  }
     
    329322  if( this->toggle)
    330323  {
    331     playable = dynamic_cast<Playable*>(playableList->front());
     324    playable = Playable::objectList().front();
    332325    this->localPlayer->setPlayable(playable);
    333326    this->toggle = !this->toggle;
     
    335328  else
    336329  {
    337     playable = dynamic_cast<Playable*>(playableList->back());
     330    playable = Playable::objectList().back();
    338331    this->localPlayer->setPlayable(playable);
    339332    this->toggle = !this->toggle;
  • branches/new_class_id/src/story_entities/single_player_world.cc

    r9406 r9709  
    2020
    2121#include "state.h"
    22 #include "class_list.h"
    2322
    2423#include "util/loading/load_param.h"
    25 #include "fast_factory.h"
     24#include "loading/fast_factory.h"
    2625#include "util/loading/factory.h"
    2726
     
    3029
    3130
    32 
    33 
    34 
     31#include "class_id.h"
    3532//! This creates a Factory to fabricate a SinglePlayerWorld
    36 CREATE_FACTORY(SinglePlayerWorld, CL_SINGLE_PLAYER_WORLD);
    37 
    38 
     33NewObjectListDefinitionID(SinglePlayerWorld, CL_SINGLE_PLAYER_WORLD);
     34CREATE_FACTORY(SinglePlayerWorld);
    3935
    4036SinglePlayerWorld::SinglePlayerWorld(const TiXmlElement* root)
    4137  : GameWorld()
    4238{
    43   this->setClassID(CL_SINGLE_PLAYER_WORLD, "SinglePlayerWorld");
     39  this->registerObject(this, SinglePlayerWorld::_objectList);
    4440  this->setName("SinglePlayerWorld uninitialized");
    4541
  • branches/new_class_id/src/story_entities/single_player_world.h

    r6512 r9709  
    2222class SinglePlayerWorld : public GameWorld
    2323{
     24  NewObjectListDeclaration(SinglePlayerWorld);
    2425
    2526  public:
  • branches/new_class_id/src/story_entities/story_entity.cc

    r9406 r9709  
    2727
    2828
    29 
     29NewObjectListDefinition(StoryEntity);
    3030
    3131/**
     
    3434StoryEntity::StoryEntity ()
    3535{
    36   this->setClassID(CL_STORY_ENTITY, "StoryEntity");
     36  this->registerObject(this, StoryEntity::_objectList);
    3737
    3838  this->bInit = false;
  • branches/new_class_id/src/story_entities/story_entity.h

    r8717 r9709  
    2626class StoryEntity : virtual public BaseObject
    2727{
     28  NewObjectListDeclaration(StoryEntity);
    2829
    2930public:
Note: See TracChangeset for help on using the changeset viewer.