Changeset 7222 for code/branches
- Timestamp:
- Aug 26, 2010, 2:27:14 AM (14 years ago)
- Location:
- code/branches/consolecommands3/src/libraries/core/command
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/consolecommands3/src/libraries/core/command/ConsoleCommand.cc
r7221 r7222 31 31 #include "util/Convert.h" 32 32 #include "core/Language.h" 33 #include "core/ BaseObject.h" // remove this33 #include "core/GameMode.h" 34 34 35 35 namespace orxonox 36 36 { 37 _SetConsoleCommand("BaseObject", "setName", &BaseObject::setName, (BaseObject*)0);38 _ConsoleCommand::_ConsoleCommandManipulator test(_ModifyConsoleCommand("BaseObject", "setName").setFunction(&BaseObject::setActive));39 40 37 _ConsoleCommand::_ConsoleCommand(const std::string& group, const std::string& name, const ExecutorPtr& executor, bool bInitialized) 41 38 { … … 94 91 { 95 92 return (this->bActive_ && this->executor_ && this->executor_->getFunctor() && (this->executor_->getFunctor()->getType() == Functor::Type::Static || this->executor_->getFunctor()->getRawObjectPointer())); 93 } 94 95 bool _ConsoleCommand::hasAccess() const 96 { 97 switch (this->accessLevel_) 98 { 99 case AccessLevel::All: return true; 100 case AccessLevel::Standalone: return GameMode::isStandalone(); 101 case AccessLevel::Master: return GameMode::isMaster(); 102 case AccessLevel::Server: return GameMode::hasServer(); 103 case AccessLevel::Client: return GameMode::isClient(); 104 case AccessLevel::Online: return (GameMode::hasServer() || GameMode::isClient()); 105 case AccessLevel::Offline: return GameMode::isStandalone(); 106 case AccessLevel::None: return false; 107 default: return false; 108 } 96 109 } 97 110 -
code/branches/consolecommands3/src/libraries/core/command/ConsoleCommand.h
r7221 r7222 242 242 bool isActive() const; 243 243 bool hasAccess() const; 244 bool isHidden() const; 244 inline bool isHidden() const 245 { return this->bHidden_; } 245 246 246 247 _ConsoleCommand& description(const std::string& description);
Note: See TracChangeset
for help on using the changeset viewer.