- Timestamp:
- Aug 25, 2010, 11:46:32 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/consolecommands3/src/libraries/core/command/ConsoleCommand.h
r7216 r7218 51 51 52 52 #define _SetConsoleCommandGeneric(group, name, functor) \ 53 orxonox::_ConsoleCommand& BOOST_PP_CAT(__consolecommand_, __LINE__) = (*orxonox::_createConsoleCommand(group, name, orxonox::createExecutor(functor)))53 static orxonox::_ConsoleCommand& BOOST_PP_CAT(__consolecommand_, __LINE__) = (*orxonox::_createConsoleCommand(group, name, orxonox::createExecutor(functor))) 54 54 55 55 … … 64 64 65 65 #define _DeclareConsoleCommandGeneric(group, name, functor) \ 66 orxonox::_ConsoleCommand& BOOST_PP_CAT(__consolecommand_, __LINE__) = orxonox::_createConsoleCommand(group, name, orxonox::createExecutor(functor), false)66 static orxonox::_ConsoleCommand& BOOST_PP_CAT(__consolecommand_, __LINE__) = (*orxonox::_createConsoleCommand(group, name, orxonox::createExecutor(functor), false)) 67 67 68 68 69 69 namespace orxonox 70 70 { 71 namespace prototype 72 { 73 inline void void__void(void) {} 74 inline void void__string(const std::string&) {} 75 } 76 77 namespace AccessLevel 78 { 79 enum Enum 80 { 81 All, 82 Standalone, 83 Master, 84 Server, 85 Client, 86 Online, 87 Offline, 88 None 89 }; 90 } 91 71 92 class _CoreExport _ConsoleCommand 72 93 { … … 77 98 ExecutorPtr executor_; 78 99 FunctorPtr functor_; 79 };80 81 struct AccessLevel82 {83 enum Enum84 {85 All,86 Standalone,87 Master,88 Server,89 Client,90 Online,91 Offline,92 None93 };94 100 }; 95 101 … … 150 156 { if (this->command_) { this->command_->popFunction(); } return *this; } 151 157 158 inline _ConsoleCommandManipulator& resetFunction() 159 { if (this->command_) { this->command_->resetFunction(); } return *this; } 160 152 161 inline _ConsoleCommandManipulator& setObject(void* object) 153 162 { if (this->command_) { this->command_->setObject(object); } return *this; } … … 184 193 { if (this->command_) { this->command_->defaultValue(index, param); } return *this; } 185 194 186 inline _ConsoleCommandManipulator& accessLevel( _ConsoleCommand::AccessLevel::Enum level)195 inline _ConsoleCommandManipulator& accessLevel(AccessLevel::Enum level) 187 196 { if (this->command_) { this->command_->accessLevel(level); } return *this; } 188 197 … … 210 219 _ConsoleCommand& addGroup(const std::string& group, const std::string& name); 211 220 212 inline _ConsoleCommand setActive(bool bActive) 221 inline const std::string& getName() const 222 { return this->baseName_; } 223 224 const ExecutorPtr& getExecutor() const; 225 inline const ExecutorPtr& getBaseExecutor() const 226 { return this->baseExecutor_; } 227 228 inline _ConsoleCommand& setActive(bool bActive) 213 229 { this->bActive_ = bActive; return *this; } 214 inline _ConsoleCommand activate()230 inline _ConsoleCommand& activate() 215 231 { return this->setActive(true); } 216 inline _ConsoleCommand deactivate()232 inline _ConsoleCommand& deactivate() 217 233 { return this->setActive(false); } 218 234 … … 291 307 void pushFunction(); 292 308 void popFunction(); 293 const ExecutorPtr& getExecutor() const; 294 const FunctorPtr& getFunctor() const; 309 void resetFunction(); 295 310 296 311 bool setObject(void* object);
Note: See TracChangeset
for help on using the changeset viewer.