Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 15, 2005, 1:34:32 AM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: packing the first entities into their lists

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/objectmanager/src/util/object_manager.cc

    r6120 r6121  
    2222
    2323#include "shell_command.h"
     24
     25#include <assert.h>
     26
    2427using namespace std;
    2528SHELL_COMMAND(debug, ObjectManager, debug)
     
    3740}
    3841
    39 /**
    40  *  the singleton reference to this class
    41  */
    42 ObjectManager* ObjectManager::singletonRef = NULL;
    4342
    4443/**
     
    5049{
    5150  this->flush();
    52   ObjectManager::singletonRef = NULL;
    5351}
    5452
     
    7876void ObjectManager::toList (WorldEntity* entity, OM_LIST omList)
    7977{
     78  assert (omList != OM_SIZE);
     79
    8080  if (likely(entity->getOMListNumber() != OM_INIT))
    8181    this->objectLists[entity->getOMListNumber()].erase(entity->getEntityIterator());
     
    127127 * @brief print out nice debug information about Elements in the list OM_LIST
    128128 * @param omList the List to debug.
    129  */
    130 void ObjectManager::debug(OM_LIST omList) const
     129 * @param level: level 0: only show list info; level 1: also show entities and their names.
     130 */
     131void ObjectManager::debug(OM_LIST omList, unsigned int level) const
    131132{
    132133  if (omList != OM_INIT || omList == OM_SIZE)
    133134  {
    134135    PRINT(0)(" +ObjectManager-LIST: '%s'-size='%d'-----\n", ObjectManager::OMListToString((OM_LIST) omList), this->objectLists[omList].size());
    135     std::list<WorldEntity*>::const_iterator entity;
    136     for (entity = this->objectLists[omList].begin(); entity != this->objectLists[omList].end(); entity++)
     136    if (level > 1)
    137137    {
    138       PRINT(0)(" | %s::%s\n",(*entity)->getClassName(), (*entity)->getName());
     138      std::list<WorldEntity*>::const_iterator entity;
     139      for (entity = this->objectLists[omList].begin(); entity != this->objectLists[omList].end(); entity++)
     140      {
     141        PRINT(0)(" | %s::%s\n",(*entity)->getClassName(), (*entity)->getName());
     142      }
    139143    }
    140144  }
     
    147151 * @brief prints out very nice debug information
    148152 * @param listName the Name of the list to get Debug information from
    149  */
    150 void ObjectManager::debug(const char* listName)
    151 {
     153 * @param level: level 0: only show list info; level 1: also show entities and their names.
     154 */
     155void ObjectManager::debug(const char* listName, unsigned int level)
     156{
     157  PRINT(0)("=================================\n");
    152158  PRINT(0)("=ObjectManager-DEBUG=============\n");
     159  PRINT(0)("=================================\n");
    153160  if (listName == NULL || listName[0] == '\0')
    154161    for (unsigned int i = 0; i < OM_SIZE; ++i)
    155       debug((OM_LIST) i);
     162      debug((OM_LIST) i, level);
    156163  else
    157164    debug(ObjectManager::StringToOMList(listName));
     
    198205    "null",
    199206    "dead",
     207    "dead-tick"
    200208    "environ-notick",
    201209    "environ",
Note: See TracChangeset for help on using the changeset viewer.