Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5885 in orxonox.OLD


Ignore:
Timestamp:
Dec 3, 2005, 1:29:42 PM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: classList: returns const lists

Location:
trunk/src
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/graphics/importer/texture_sequence.cc

    r5865 r5885  
    155155
    156156/**
    157  * moves to the n'th texture which can then be retrieved via the Texture function: this->getTexture()
     157 * @brief moves to the n'th texture which can then be retrieved via the Texture function: this->getTexture()
    158158 * @param frameNumber the n-th frame
    159159 */
  • trunk/src/lib/graphics/text_engine/text_engine.cc

    r5780 r5885  
    6464{
    6565  // first remove all the remaining Texts (if any).
    66   std::list<BaseObject*>* textList = ClassList::getList(CL_TEXT);
     66  const std::list<BaseObject*>* textList = ClassList::getList(CL_TEXT);
    6767  if (textList != NULL)
    6868  {
     
    7171  }
    7272  // delete all remaining fonts (There should not be Anything to do here)
    73   std::list<BaseObject*>* fontList = ClassList::getList(CL_FONT);
     73  const std::list<BaseObject*>* fontList = ClassList::getList(CL_FONT);
    7474  if (fontList != NULL)
    7575  {
     
    124124void TextEngine::debug() const
    125125{
    126   list<BaseObject*>* textList = ClassList::getList(CL_TEXT);
     126  const list<BaseObject*>* textList = ClassList::getList(CL_TEXT);
    127127  if (textList != NULL)
    128128  {
     
    132132    PRINT(0)("Reference: %p; Text Counts: %d\n", this, textList->size());
    133133
    134     list<BaseObject*>::iterator text;
     134    list<BaseObject*>::const_iterator text;
    135135    for ( text = textList->begin(); text != textList->end(); text++)
    136136      dynamic_cast<Text*>(*text)->debug();
  • trunk/src/lib/lang/class_list.cc

    r5822 r5885  
    133133 * @return the List accessed by classID, or NULL if not found
    134134 */
    135 std::list<BaseObject*>* ClassList::getList(ClassID classID)
     135const std::list<BaseObject*>* ClassList::getList(ClassID classID)
    136136{
    137137  ClassList* fl;
     
    156156 * @return the List accessed by classID, or NULL if not found
    157157 */
    158 std::list<BaseObject*>* ClassList::getList(const char* className)
     158const std::list<BaseObject*>* ClassList::getList(const char* className)
    159159{
    160160  ClassList* fl;
  • trunk/src/lib/lang/class_list.h

    r5821 r5885  
    4040    static void                           removeFromClassList(BaseObject* objectPointer);
    4141
    42     static std::list<BaseObject*>*        getList(ClassID classID = CL_NULL);// { return (ClassList* fl = ClassList::getClassList(classID) != NULL)? &(fl->objectList) : NULL; };
    43     static std::list<BaseObject*>*        getList(const char* className); // { return (ClassList* fl = ClassList::getClassList(className) != NULL)? &(fl->objectList) : NULL;  };
     42    static const std::list<BaseObject*>*  getList(ClassID classID = CL_NULL);// { return (ClassList* fl = ClassList::getClassList(classID) != NULL)? &(fl->objectList) : NULL; };
     43    static const std::list<BaseObject*>*  getList(const char* className); // { return (ClassList* fl = ClassList::getClassList(className) != NULL)? &(fl->objectList) : NULL;  };
    4444    static const std::list<const char*>*  getClassNames();
    4545    static BaseObject*                    getObject(const char* name, ClassID classID = CL_NULL);
  • trunk/src/lib/network/network_manager.cc

    r5822 r5885  
    161161  if (this->netStreamList != NULL || (this->netStreamList = ClassList::getList(CL_NETWORK_STREAM)) != NULL)
    162162  {
    163     std::list<BaseObject*>::iterator stream;
     163    std::list<BaseObject*>::const_iterator stream;
    164164    for (stream = this->netStreamList->begin(); stream != this->netStreamList->end(); ++stream)
    165165      static_cast<NetworkStream*>(*stream)->processData();
  • trunk/src/lib/network/network_manager.h

    r5822 r5885  
    4141
    4242private:
    43   std::list<BaseObject*>*    netStreamList;            // list with refs to all network streams
    44   std::list<BaseObject*>*    syncList;                 // list of synchronizeables
     43  const std::list<BaseObject*>*    netStreamList;            // list with refs to all network streams
     44  const std::list<BaseObject*>*    syncList;                 // list of synchronizeables
    4545
    4646};
  • trunk/src/lib/shell/shell_command.cc

    r5791 r5885  
    159159  long classID = CL_NULL;                      //< the classID retrieved from the Class.
    160160  ShellCommandClass* commandClass = NULL;      //< the command class this command applies to.
    161   std::list<BaseObject*>* objectList = NULL;   //< the list of Objects stored in classID
     161  const std::list<BaseObject*>* objectList = NULL;   //< the list of Objects stored in classID
    162162  BaseObject* objectPointer = NULL;            //< a pointer to th Object to Execute the command on
    163163  bool emptyComplete = false;                  //< if the completion input is empty string. e.g ""
  • trunk/src/lib/shell/shell_completion.cc

    r5791 r5885  
    5858
    5959  long classID;                         //< the classID retrieved from the Class.
    60   std::list<BaseObject*>* objectList;   //< the list of Objects stored in classID
     60  const std::list<BaseObject*>* objectList;   //< the list of Objects stored in classID
    6161  bool emptyComplete = false;           //< if the completion input is empty string. e.g ""
    6262  long completeType = SHELLC_NONE;      //< the Type we'd like to complete.
  • trunk/src/lib/sound/sound_engine.cc

    r5856 r5885  
    137137  if (this->sourceList != NULL)
    138138  {
    139     list<BaseObject*>::iterator source;
     139    list<BaseObject*>::const_iterator source;
    140140    for (source = this->sourceList->begin(); source != this->sourceList->end(); source++)
    141141    {
     
    182182  if (likely(this->sourceList != NULL))
    183183  {
    184     list<BaseObject*>::iterator sourceIT;
     184    list<BaseObject*>::const_iterator sourceIT;
    185185    SoundSource* source;
    186186    for (sourceIT = this->sourceList->begin(); sourceIT != this->sourceList->end(); sourceIT++)
  • trunk/src/lib/sound/sound_engine.h

    r5819 r5885  
    6666
    6767  private:
    68     static SoundEngine*      singletonRef;             //!< Reference to this class
     68    static SoundEngine*            singletonRef;             //!< Reference to this class
    6969
    70     ALCdevice*               device;                   //!< the used audio-device.
    71     ALCcontext*              context;                  //!< the context, currently in use.
     70    ALCdevice*                     device;                   //!< the used audio-device.
     71    ALCcontext*                    context;                  //!< the context, currently in use.
    7272
    73     float                    musicVolume;              //!< the maximum volume of the music in % (0f,1f]
    74     float                    effectsVolume;            //!< the maximum volume of sound-effects in % (0f,1f]
    75     PNode*                   listener;                 //!< The listener of the Scene
     73    float                          musicVolume;              //!< the maximum volume of the music in % (0f,1f]
     74    float                          effectsVolume;            //!< the maximum volume of sound-effects in % (0f,1f]
     75    PNode*                         listener;                 //!< The listener of the Scene
    7676
    77     std::list<BaseObject*>*  bufferList;               //!< A list of buffers
    78     std::list<BaseObject*>*  sourceList;               //!< A list for all the sources in the scene.
     77    const std::list<BaseObject*>*  bufferList;               //!< A list of buffers
     78    const std::list<BaseObject*>*  sourceList;               //!< A list for all the sources in the scene.
    7979
    8080
  • trunk/src/world_entities/weapons/weapon_manager.cc

    r5779 r5885  
    110110  this->crossHairSizeAnim->addKeyFrame(100, .05, ANIM_LINEAR);
    111111  this->crossHairSizeAnim->addKeyFrame(50, .01, ANIM_LINEAR);
    112 
    113   this->targetIterator = NULL;
    114112}
    115113
     
    337335    }
    338336  }
    339 }
    340 
    341 
    342 /**
    343  * Selects an Entity from the NPC-list, and returns the Target
    344  */
    345 PNode* WeaponManager::getSomeTarget()
    346 {
    347    if (this->targetIterator == NULL)
    348    {
    349      std::list<BaseObject*>* npcList = ClassList::getList(CL_NPC);
    350      if (npcList != NULL)
    351      {
    352        this->targetIterator = npcList->begin();
    353      }
    354      else
    355        return NULL;
    356    }
    357 
    358    ///FIXME
    359 //   this->targetIterator++;
    360    PNode* retNode = dynamic_cast<PNode*>((*targetIterator));
    361 //   if (retNode == NULL && this->targetIterator->getList()->getSize() > 0)
    362 //     retNode =  dynamic_cast<PNode*>(targetIterator->firstElement());
    363 
    364    return retNode;
    365 }
    366 
    367 
    368 /**
    369  * Selects an Entity from the Entity-List, that is near of the carrier PNode.
    370  * @param carrier: The PNode from which the distance should be measured
    371  * @param distance: The Maximum Distance to Return.
    372  */
    373 PNode* WeaponManager::getDistanceTarget(const PNode* carrier, float distance)
    374 {
    375   std::list<BaseObject*>* npcList = ClassList::getList(CL_NPC);
    376   if (npcList != NULL)
    377   {
    378     list<BaseObject*>::iterator node;
    379     for (node= npcList->begin(); node != npcList->end(); node++)
    380       if ((carrier->getAbsCoor() - dynamic_cast<PNode*>(*node)->getAbsCoor()).len() < distance)
    381         return dynamic_cast<PNode*>(*node);
    382   }
    383   return this->getFixedTarget();
    384337}
    385338
  • trunk/src/world_entities/weapons/weapon_manager.h

    r5779 r5885  
    8080    /** @returns a fixed target namely the Crosshair's 3D position */
    8181    inline PNode* getFixedTarget() const { return this->crosshair; };
    82     PNode* getSomeTarget();
    83     PNode* getDistanceTarget(const PNode* carrier, float distance);
    8482
    8583    void fire();
     
    109107    Crosshair*              crosshair;                                //!< an aim.
    110108    tAnimation<Crosshair>*  crossHairSizeAnim;                        //!< An animation for the crosshair (scaling)
    111 
    112     std::list<BaseObject*>::iterator  targetIterator;                           //!< An iterator for traversion lists of enemies.
    113109};
Note: See TracChangeset for help on using the changeset viewer.