Changeset 9692 in orxonox.OLD for branches/new_class_id/src/lib/shell
- Timestamp:
- Aug 23, 2006, 12:43:25 AM (18 years ago)
- Location:
- branches/new_class_id/src/lib/shell
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/new_class_id/src/lib/shell/shell.cc
r8362 r9692 54 54 ->completionPlugin(0, OrxShell::CompletorFileSystem(".ttf", "fonts/")); 55 55 56 NewObjectListDefinition(Shell); 56 57 57 58 /** … … 60 61 Shell::Shell () 61 62 { 62 this->setClassID(CL_SHELL, "Shell"); 63 this->registerObject(this, Shell::_objectList); 64 63 65 this->setName("Shell"); 64 66 -
branches/new_class_id/src/lib/shell/shell.h
r7762 r9692 48 48 class Shell : public Element2D, public EventListener 49 49 { 50 50 NewObjectListDeclaration(Shell); 51 51 public: 52 52 Shell(); -
branches/new_class_id/src/lib/shell/shell_buffer.h
r8145 r9692 24 24 class ShellBuffer 25 25 { 26 27 26 public: 28 27 virtual ~ShellBuffer(); -
branches/new_class_id/src/lib/shell/shell_command.cc
r9406 r9692 21 21 #include "compiler.h" 22 22 #include "debug.h" 23 #include "class_list.h"24 23 25 24 #include "key_names.h" … … 28 27 { 29 28 SHELL_COMMAND(debug, ShellCommandClass, help); 29 NewObjectListDefinition(ShellCommand); 30 30 31 31 … … 38 38 ShellCommand::ShellCommand(const std::string& commandName, const std::string& className, Executor* executor) 39 39 { 40 this-> setClassID(CL_SHELL_COMMAND, "ShellCommand");40 this->registerObject(this, ShellCommand::_objectList); 41 41 PRINTF(4)("create shellcommand '%s' for class '%s'\n", commandName.c_str(), className.c_str()); 42 42 this->setName(commandName); … … 94 94 void ShellCommand::unregisterCommand(const std::string& commandName, const std::string& className) 95 95 { 96 97 96 ShellCommandClass* cmdClass = ShellCommandClass::acquireCommandClass(className); 98 97 if (cmdClass != NULL) 99 98 { 100 99 CmdList::iterator cmd; 101 for (cmd = cmdClass-> commandList.begin(); cmd != cmdClass->commandList.end(); cmd++)100 for (cmd = cmdClass->_commandList.begin(); cmd != cmdClass->_commandList.end(); cmd++) 102 101 if (commandName == (*cmd)->getName()) 103 102 { … … 119 118 120 119 CmdList::const_iterator elem; 121 for (unsigned int i = 0; i < cmdClass-> commandList.size(); i++)122 { 123 if (commandName == cmdClass-> commandList[i]->getName())124 return (cmdClass-> commandList[i]);120 for (unsigned int i = 0; i < cmdClass->_commandList.size(); i++) 121 { 122 if (commandName == cmdClass->_commandList[i]->getName()) 123 return (cmdClass->_commandList[i]); 125 124 } 126 125 return NULL; -
branches/new_class_id/src/lib/shell/shell_command.h
r8145 r9692 58 58 class ShellCommand : public BaseObject 59 59 { 60 NewObjectListDeclaration(ShellCommand); 61 60 62 friend class ShellCommandClass; 61 63 public: -
branches/new_class_id/src/lib/shell/shell_command_class.cc
r9406 r9692 21 21 22 22 #include "debug.h" 23 #include "class_list.h"24 23 #include "compiler.h" 25 24 … … 28 27 namespace OrxShell 29 28 { 29 NewObjectListDefinition(ShellCommandClass); 30 30 31 CmdClassList* ShellCommandClass::commandClassList = NULL; 31 32 … … 35 36 */ 36 37 ShellCommandClass::ShellCommandClass(const std::string& className) 37 : className(className)38 { 39 this-> setClassID(CL_SHELL_COMMAND_CLASS, "ShellCommandClass");38 : _className(className) 39 { 40 this->registerObject(this, ShellCommandClass::_objectList); 40 41 this->setName(className); 41 42 -
branches/new_class_id/src/lib/shell/shell_command_class.h
r8362 r9692 25 25 class ShellCommandClass : public BaseObject 26 26 { 27 NewObjectListDeclaration(ShellCommandClass); 28 27 29 friend class ShellCommand; 28 30 public: 29 31 /** @returns the CommandClassList */ 30 static const CmdClassList& getCommandClassList() { return *ShellCommandClass:: commandClassList; };32 static const CmdClassList& getCommandClassList() { return *ShellCommandClass::_commandClassList; }; 31 33 32 34 static bool getCommandListOfClass(const std::string& className, std::list<std::string>& stringList); … … 34 36 static void unregisterAllCommands(); 35 37 static ShellCommandClass* getCommandClass(const std::string& className); 36 ClassID getClassID();38 NewClassID getClassID(); 37 39 static bool exists(const std::string& className); 38 40 … … 51 53 52 54 private: 53 const std::string className; //!< The Name of the Class. This should match the ClassName of the Commands Class.54 ClassIDclassID; //!< The classID of this Class55 CmdList commandList; //!< A list of Commands from this Class55 const std::string _className; //!< The Name of the Class. This should match the ClassName of the Commands Class. 56 NewClassID _classID; //!< The classID of this Class 57 CmdList _commandList; //!< A list of Commands from this Class 56 58 57 static CmdClassList* commandClassList; //!< A list of Classes59 static CmdClassList* _commandClassList; //!< A list of Classes 58 60 }; 59 61 } -
branches/new_class_id/src/lib/shell/shell_input.cc
r8339 r9692 24 24 #include "compiler.h" 25 25 #include "key_names.h" 26 26 27 27 28 namespace OrxShell … … 31 32 ->setAlias("help"); 32 33 34 NewObjectListDefinition(ShellInput); 33 35 34 36 /** … … 39 41 : Text ("") 40 42 { 43 this->registerObject(this, ShellInput::_objectList); 44 41 45 this->pressedKey = SDLK_FIRST; 42 this->setClassID(CL_SHELL_INPUT, "ShellInput");43 46 44 47 this->inputLine = ""; -
branches/new_class_id/src/lib/shell/shell_input.h
r7858 r9692 30 30 class ShellInput : public Text, public EventListener 31 31 { 32 NewObjectListDeclaration(ShellInput); 32 33 33 34 public:
Note: See TracChangeset
for help on using the changeset viewer.