Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5105 in orxonox.OLD for trunk/src/lib/lang/class_list.cc


Ignore:
Timestamp:
Aug 22, 2005, 7:29:27 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: some completion of ObjectNames

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/lang/class_list.cc

    r5103 r5105  
    285285}
    286286
     287const char* ClassList::IDToString(ClassID classID)
     288{
     289  if(likely(ClassList::first != NULL))
     290  {
     291    ClassList* tmpCL = ClassList::first;
     292    while (likely(tmpCL != NULL))
     293    {
     294      if (tmpCL->classID == classID)
     295        return tmpCL->className;
     296      tmpCL = tmpCL->next;
     297    }
     298  }
     299  return NULL;
     300}
     301
     302long ClassList::StringToID(const char* className)
     303{
     304  if(likely(ClassList::first != NULL))
     305  {
     306    ClassList* tmpCL = ClassList::first;
     307    while (likely(tmpCL != NULL))
     308    {
     309      if (!strcasecmp(tmpCL->className, className))
     310        return tmpCL->classID;
     311      tmpCL = tmpCL->next;
     312    }
     313  }
     314  return CL_NULL;
     315}
     316
     317
     318
    287319/**
    288320 * Print out some very nice debug information
Note: See TracChangeset for help on using the changeset viewer.