Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5140 in orxonox.OLD for trunk/src/util


Ignore:
Timestamp:
Aug 26, 2005, 2:15:06 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: now all new commands get subscribed

Location:
trunk/src/util
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/util/shell_command.cc

    r5138 r5140  
    3434
    3535  this->classID = classID;
     36  if (classID & CL_MASK_SINGLETON == CL_MASK_SINGLETON)
     37    this->isSingleton = true;
     38  else
     39    this->isSingleton = false;
     40
    3641  this->commandName = new char[strlen(commandName)+1];
    3742  strcpy(this->commandName, commandName);
     
    7580    if (classID == elem->classID && !strcmp(commandName, elem->commandName))
    7681    {
    77 //      PRINTF(2)("Command already registered\n");
     82      PRINTF(2)("Command already registered\n");
    7883      delete iterator;
    7984      return true;
     
    8287  }
    8388  delete iterator;
    84   return true;
     89  return false;
    8590}
     91
    8692
    8793bool ShellCommandBase::execute(const char* executionString)
     
    98104  while(elem != NULL)
    99105  {
     106    printf("%s\n", elem->commandName);
    100107    if (!strncmp(executionString, elem->commandName, strlen(elem->commandName)))
    101108    {
  • trunk/src/util/shell_command.h

    r5139 r5140  
    6565    unsigned int                     paramCount;          //!< the count of parameters
    6666    ParameterType*                   parameters;          //!< Parameters
     67    bool                             isSingleton;         //!< if the Class is Singleton @todo autocheck
    6768
    6869  private:
     
    123124    virtual void executeCommand (const char* parameters)
    124125    {
     126      printf("not implemented yet\n");
    125127/*      if (this->paramCount == 0)
    126128        (objectPointer->*functionPointer_NULL)();*/
Note: See TracChangeset for help on using the changeset viewer.