[1505] | 1 | /* |
---|
| 2 | * ORXONOX - the hottest 3D action shooter ever to exist |
---|
| 3 | * > www.orxonox.net < |
---|
| 4 | * |
---|
| 5 | * |
---|
| 6 | * License notice: |
---|
| 7 | * |
---|
| 8 | * This program is free software; you can redistribute it and/or |
---|
| 9 | * modify it under the terms of the GNU General Public License |
---|
| 10 | * as published by the Free Software Foundation; either version 2 |
---|
| 11 | * of the License, or (at your option) any later version. |
---|
| 12 | * |
---|
| 13 | * This program is distributed in the hope that it will be useful, |
---|
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
| 16 | * GNU General Public License for more details. |
---|
| 17 | * |
---|
| 18 | * You should have received a copy of the GNU General Public License |
---|
| 19 | * along with this program; if not, write to the Free Software |
---|
| 20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
---|
| 21 | * |
---|
| 22 | * Author: |
---|
| 23 | * Fabian 'x3n' Landau |
---|
| 24 | * Co-authors: |
---|
| 25 | * ... |
---|
| 26 | * |
---|
| 27 | */ |
---|
| 28 | |
---|
| 29 | #include "ConsoleCommand.h" |
---|
| 30 | |
---|
[7214] | 31 | #include "util/Convert.h" |
---|
[7203] | 32 | #include "core/Language.h" |
---|
| 33 | #include "core/BaseObject.h" // remove this |
---|
[7179] | 34 | |
---|
| 35 | namespace orxonox |
---|
| 36 | { |
---|
| 37 | _SetConsoleCommand("BaseObject", "setName", &BaseObject::setName, (BaseObject*)0); |
---|
| 38 | _ConsoleCommand::_ConsoleCommandManipulator test(_ModifyConsoleCommand("BaseObject", "setName").setFunction(&BaseObject::setActive)); |
---|
| 39 | |
---|
[7214] | 40 | _ConsoleCommand::_ConsoleCommand(const std::string& group, const std::string& name, const ExecutorPtr& executor, bool bInitialized) |
---|
[7179] | 41 | { |
---|
[7185] | 42 | this->bActive_ = true; |
---|
[7215] | 43 | this->bHidden_ = false; |
---|
| 44 | this->accessLevel_ = AccessLevel::All; |
---|
| 45 | |
---|
[7214] | 46 | this->baseName_ = name; |
---|
| 47 | this->baseExecutor_ = executor; |
---|
| 48 | |
---|
[7215] | 49 | this->argumentCompleter_[0] = 0; |
---|
| 50 | this->argumentCompleter_[1] = 0; |
---|
| 51 | this->argumentCompleter_[2] = 0; |
---|
| 52 | this->argumentCompleter_[3] = 0; |
---|
| 53 | this->argumentCompleter_[4] = 0; |
---|
| 54 | |
---|
| 55 | this->keybindMode_ = KeybindMode::OnPress; |
---|
| 56 | this->inputConfiguredParam_ = -1; |
---|
| 57 | |
---|
[7214] | 58 | if (bInitialized) |
---|
| 59 | this->executor_ = executor; |
---|
| 60 | |
---|
[7179] | 61 | _ConsoleCommand::registerCommand(group, name, this); |
---|
| 62 | } |
---|
| 63 | |
---|
[7214] | 64 | _ConsoleCommand::~_ConsoleCommand() |
---|
| 65 | { |
---|
| 66 | _ConsoleCommand::unregisterCommand(this); |
---|
| 67 | } |
---|
| 68 | |
---|
[7179] | 69 | _ConsoleCommand& _ConsoleCommand::addShortcut() |
---|
| 70 | { |
---|
[7214] | 71 | _ConsoleCommand::registerCommand("", this->baseName_, this); |
---|
[7179] | 72 | return *this; |
---|
| 73 | } |
---|
| 74 | |
---|
| 75 | _ConsoleCommand& _ConsoleCommand::addShortcut(const std::string& name) |
---|
| 76 | { |
---|
| 77 | _ConsoleCommand::registerCommand("", name, this); |
---|
| 78 | return *this; |
---|
| 79 | } |
---|
| 80 | |
---|
| 81 | _ConsoleCommand& _ConsoleCommand::addGroup(const std::string& group) |
---|
| 82 | { |
---|
[7214] | 83 | _ConsoleCommand::registerCommand(group, this->baseName_, this); |
---|
[7179] | 84 | return *this; |
---|
| 85 | } |
---|
| 86 | |
---|
| 87 | _ConsoleCommand& _ConsoleCommand::addGroup(const std::string& group, const std::string& name) |
---|
| 88 | { |
---|
| 89 | _ConsoleCommand::registerCommand(group, name, this); |
---|
| 90 | return *this; |
---|
| 91 | } |
---|
| 92 | |
---|
[7214] | 93 | bool _ConsoleCommand::isActive() const |
---|
[7179] | 94 | { |
---|
[7214] | 95 | return (this->bActive_ && this->executor_ && this->executor_->getFunctor()); |
---|
| 96 | } |
---|
| 97 | |
---|
| 98 | bool _ConsoleCommand::headersMatch(const FunctorPtr& functor) |
---|
| 99 | { |
---|
| 100 | unsigned int minparams = std::min(this->baseExecutor_->getParamCount(), functor->getParamCount()); |
---|
| 101 | |
---|
| 102 | if (this->baseExecutor_->getFunctor()->getHeaderIdentifier(minparams) != functor->getHeaderIdentifier(minparams)) |
---|
| 103 | return false; |
---|
| 104 | else if (functor->getParamCount() <= this->baseExecutor_->getParamCount()) |
---|
| 105 | return true; |
---|
| 106 | else if (!this->executor_) |
---|
| 107 | return false; |
---|
| 108 | else |
---|
[7179] | 109 | { |
---|
[7214] | 110 | for (unsigned int i = this->baseExecutor_->getParamCount(); i < functor->getParamCount(); ++i) |
---|
| 111 | if (!this->executor_->defaultValueSet(i)) |
---|
| 112 | return false; |
---|
| 113 | |
---|
[7185] | 114 | return true; |
---|
[7179] | 115 | } |
---|
[7214] | 116 | } |
---|
[7185] | 117 | |
---|
[7214] | 118 | bool _ConsoleCommand::headersMatch(const ExecutorPtr& executor) |
---|
| 119 | { |
---|
| 120 | unsigned int minparams = std::min(this->baseExecutor_->getParamCount(), executor->getParamCount()); |
---|
| 121 | |
---|
| 122 | if (this->baseExecutor_->getFunctor()->getHeaderIdentifier(minparams) != executor->getFunctor()->getHeaderIdentifier(minparams)) |
---|
| 123 | return false; |
---|
| 124 | else if (executor->getParamCount() <= this->baseExecutor_->getParamCount()) |
---|
| 125 | return true; |
---|
| 126 | else |
---|
[7179] | 127 | { |
---|
[7214] | 128 | for (unsigned int i = this->baseExecutor_->getParamCount(); i < executor->getParamCount(); ++i) |
---|
| 129 | if (!executor->defaultValueSet(i)) |
---|
| 130 | return false; |
---|
| 131 | |
---|
| 132 | return true; |
---|
| 133 | } |
---|
| 134 | } |
---|
| 135 | |
---|
| 136 | bool _ConsoleCommand::setFunction(const ExecutorPtr& executor, bool bForce) |
---|
| 137 | { |
---|
| 138 | if (!executor || !executor->getFunctor() || bForce || this->headersMatch(executor)) |
---|
| 139 | { |
---|
| 140 | this->executor_ = executor; |
---|
| 141 | return true; |
---|
| 142 | } |
---|
| 143 | else |
---|
| 144 | { |
---|
| 145 | COUT(1) << "Error: Couldn't assign new executor to console command \"" << this->baseName_ << "\", headers don't match." << std::endl; |
---|
[7185] | 146 | return false; |
---|
[7179] | 147 | } |
---|
[7214] | 148 | } |
---|
[7185] | 149 | |
---|
[7214] | 150 | bool _ConsoleCommand::setFunction(const FunctorPtr& functor, bool bForce) |
---|
| 151 | { |
---|
| 152 | if (!functor || bForce || this->headersMatch(functor)) |
---|
| 153 | { |
---|
| 154 | if (this->executor_) |
---|
| 155 | this->executor_->setFunctor(functor); |
---|
| 156 | else |
---|
| 157 | this->executor_ = createExecutor(functor); |
---|
| 158 | |
---|
| 159 | return true; |
---|
| 160 | } |
---|
| 161 | else |
---|
| 162 | { |
---|
| 163 | COUT(1) << "Error: Couldn't assign new functor to console command \"" << this->baseName_ << "\", headers don't match." << std::endl; |
---|
| 164 | return false; |
---|
| 165 | } |
---|
[7179] | 166 | } |
---|
| 167 | |
---|
[7214] | 168 | void _ConsoleCommand::pushFunction(const ExecutorPtr& executor, bool bForce) |
---|
[7179] | 169 | { |
---|
[7214] | 170 | Command command; |
---|
| 171 | command.executor_ = this->getExecutor(); |
---|
| 172 | if (command.executor_) |
---|
[7215] | 173 | command.functor_ = this->getExecutor()->getFunctor(); |
---|
[7185] | 174 | |
---|
[7214] | 175 | if (this->setFunction(executor, bForce)) |
---|
| 176 | this->commandStack_.push(command); |
---|
[7179] | 177 | } |
---|
| 178 | |
---|
[7214] | 179 | void _ConsoleCommand::pushFunction(const FunctorPtr& functor, bool bForce) |
---|
[7179] | 180 | { |
---|
[7214] | 181 | Command command; |
---|
| 182 | command.executor_ = this->getExecutor(); |
---|
| 183 | if (command.executor_) |
---|
[7215] | 184 | command.functor_ = this->getExecutor()->getFunctor(); |
---|
[7214] | 185 | |
---|
| 186 | if (this->setFunction(functor, bForce)) |
---|
| 187 | this->commandStack_.push(command); |
---|
[7185] | 188 | } |
---|
[7179] | 189 | |
---|
[7214] | 190 | void _ConsoleCommand::pushFunction() |
---|
[7185] | 191 | { |
---|
[7214] | 192 | if (this->executor_) |
---|
| 193 | this->pushFunction(new Executor(*this->executor_.get())); |
---|
| 194 | else |
---|
| 195 | COUT(1) << "Error: Couldn't push copy of executor in console command \"" << this->baseName_ << "\", no executor set." << std::endl; |
---|
[7179] | 196 | } |
---|
| 197 | |
---|
[7214] | 198 | void _ConsoleCommand::popFunction() |
---|
[7179] | 199 | { |
---|
[7214] | 200 | Command command; |
---|
| 201 | if (!this->commandStack_.empty()) |
---|
[7179] | 202 | { |
---|
[7214] | 203 | command = this->commandStack_.top(); |
---|
| 204 | this->commandStack_.pop(); |
---|
[7179] | 205 | } |
---|
[7214] | 206 | |
---|
| 207 | this->executor_ = command.executor_; |
---|
| 208 | if (command.executor_) |
---|
| 209 | this->executor_->setFunctor(command.functor_); |
---|
[7179] | 210 | } |
---|
| 211 | |
---|
[7214] | 212 | const ExecutorPtr& _ConsoleCommand::getExecutor() const |
---|
[7179] | 213 | { |
---|
[7214] | 214 | return this->executor_; |
---|
[7179] | 215 | } |
---|
| 216 | |
---|
[7214] | 217 | bool _ConsoleCommand::setObject(void* object) |
---|
| 218 | { |
---|
| 219 | if (this->executor_) |
---|
[7185] | 220 | { |
---|
[7214] | 221 | if (this->executor_->getFunctor()) |
---|
| 222 | { |
---|
| 223 | this->executor_->getFunctor()->setRawObjectPointer(object); |
---|
| 224 | return true; |
---|
| 225 | } |
---|
| 226 | else if (object) |
---|
| 227 | COUT(1) << "Error: Can't assign object to console command \"" << this->baseName_ << "\", no functor set." << std::endl; |
---|
[7185] | 228 | } |
---|
[7214] | 229 | else if (object) |
---|
| 230 | COUT(1) << "Error: Can't assign object to console command \"" << this->baseName_ << "\", no executor set." << std::endl; |
---|
| 231 | |
---|
| 232 | return false; |
---|
[7179] | 233 | } |
---|
| 234 | |
---|
[7214] | 235 | void _ConsoleCommand::pushObject(void* object) |
---|
| 236 | { |
---|
| 237 | void* oldobject = this->getObject(); |
---|
| 238 | if (this->setObject(object)) |
---|
| 239 | this->objectStack_.push(oldobject); |
---|
| 240 | } |
---|
| 241 | |
---|
[7185] | 242 | void _ConsoleCommand::popObject() |
---|
| 243 | { |
---|
| 244 | void* newobject = 0; |
---|
| 245 | if (!this->objectStack_.empty()) |
---|
| 246 | { |
---|
| 247 | newobject = this->objectStack_.top(); |
---|
| 248 | this->objectStack_.pop(); |
---|
| 249 | } |
---|
| 250 | this->setObject(newobject); |
---|
| 251 | } |
---|
| 252 | |
---|
| 253 | void* _ConsoleCommand::getObject() const |
---|
| 254 | { |
---|
[7214] | 255 | if (this->executor_ && this->executor_->getFunctor()) |
---|
| 256 | return this->executor_->getFunctor()->getRawObjectPointer(); |
---|
[7185] | 257 | else |
---|
| 258 | return 0; |
---|
| 259 | } |
---|
| 260 | |
---|
[7215] | 261 | _ConsoleCommand& _ConsoleCommand::defaultValues(const MultiType& param1) |
---|
| 262 | { |
---|
| 263 | if (this->executor_) |
---|
| 264 | this->executor_->setDefaultValues(param1); |
---|
| 265 | else |
---|
| 266 | COUT(1) << "Error: Can't set default values in console command \"" << this->baseName_ << "\", no executor set." << std::endl; |
---|
| 267 | |
---|
| 268 | return *this; |
---|
| 269 | } |
---|
| 270 | |
---|
| 271 | _ConsoleCommand& _ConsoleCommand::defaultValues(const MultiType& param1, const MultiType& param2) |
---|
| 272 | { |
---|
| 273 | if (this->executor_) |
---|
| 274 | this->executor_->setDefaultValues(param1, param2); |
---|
| 275 | else |
---|
| 276 | COUT(1) << "Error: Can't set default values in console command \"" << this->baseName_ << "\", no executor set." << std::endl; |
---|
| 277 | |
---|
| 278 | return *this; |
---|
| 279 | } |
---|
| 280 | |
---|
| 281 | _ConsoleCommand& _ConsoleCommand::defaultValues(const MultiType& param1, const MultiType& param2, const MultiType& param3) |
---|
| 282 | { |
---|
| 283 | if (this->executor_) |
---|
| 284 | this->executor_->setDefaultValues(param1, param2, param3); |
---|
| 285 | else |
---|
| 286 | COUT(1) << "Error: Can't set default values in console command \"" << this->baseName_ << "\", no executor set." << std::endl; |
---|
| 287 | |
---|
| 288 | return *this; |
---|
| 289 | } |
---|
| 290 | |
---|
| 291 | _ConsoleCommand& _ConsoleCommand::defaultValues(const MultiType& param1, const MultiType& param2, const MultiType& param3, const MultiType& param4) |
---|
| 292 | { |
---|
| 293 | if (this->executor_) |
---|
| 294 | this->executor_->setDefaultValues(param1, param2, param3, param4); |
---|
| 295 | else |
---|
| 296 | COUT(1) << "Error: Can't set default values in console command \"" << this->baseName_ << "\", no executor set." << std::endl; |
---|
| 297 | |
---|
| 298 | return *this; |
---|
| 299 | } |
---|
| 300 | |
---|
| 301 | _ConsoleCommand& _ConsoleCommand::defaultValues(const MultiType& param1, const MultiType& param2, const MultiType& param3, const MultiType& param4, const MultiType& param5) |
---|
| 302 | { |
---|
| 303 | if (this->executor_) |
---|
| 304 | this->executor_->setDefaultValues(param1, param2, param3, param4, param5); |
---|
| 305 | else |
---|
| 306 | COUT(1) << "Error: Can't set default values in console command \"" << this->baseName_ << "\", no executor set." << std::endl; |
---|
| 307 | |
---|
| 308 | return *this; |
---|
| 309 | } |
---|
| 310 | |
---|
| 311 | _ConsoleCommand& _ConsoleCommand::defaultValue(unsigned int index, const MultiType& param) |
---|
| 312 | { |
---|
| 313 | if (this->executor_) |
---|
| 314 | this->executor_->setDefaultValue(index, param); |
---|
| 315 | else |
---|
| 316 | COUT(1) << "Error: Can't set default values in console command \"" << this->baseName_ << "\", no executor set." << std::endl; |
---|
| 317 | |
---|
| 318 | return *this; |
---|
| 319 | } |
---|
| 320 | |
---|
| 321 | _ConsoleCommand& _ConsoleCommand::argumentCompleter(unsigned int param, ArgumentCompleter* completer) |
---|
| 322 | { |
---|
| 323 | if (param < 5) |
---|
| 324 | this->argumentCompleter_[param] = completer; |
---|
| 325 | else |
---|
| 326 | COUT(2) << "Warning: Couldn't add autocompletion-function for param " << param << " in console command \"" << this->baseName_ << "\": index out of bound." << std::endl; |
---|
| 327 | |
---|
| 328 | return *this; |
---|
| 329 | } |
---|
| 330 | |
---|
| 331 | ArgumentCompleter* _ConsoleCommand::getArgumentCompleter(unsigned int param) const |
---|
| 332 | { |
---|
| 333 | if (param < 5) |
---|
| 334 | return this->argumentCompleter_[param]; |
---|
| 335 | else |
---|
| 336 | return 0; |
---|
| 337 | } |
---|
| 338 | |
---|
| 339 | void _ConsoleCommand::createArgumentCompletionList(unsigned int param, const std::string& param1, const std::string& param2, const std::string& param3, const std::string& param4, const std::string& param5) |
---|
| 340 | { |
---|
| 341 | if (param < 5 && this->argumentCompleter_[param]) |
---|
| 342 | this->argumentList_ = (*this->argumentCompleter_[param])(param1, param2, param3, param4, param5); |
---|
| 343 | else |
---|
| 344 | this->argumentList_.clear(); |
---|
| 345 | } |
---|
| 346 | |
---|
| 347 | _ConsoleCommand& _ConsoleCommand::description(const std::string& description) |
---|
| 348 | { |
---|
| 349 | this->description_ = std::string("ConsoleCommandDescription::" + this->baseName_ + "::function"); |
---|
| 350 | AddLanguageEntry(this->description_, description); |
---|
| 351 | return *this; |
---|
| 352 | } |
---|
| 353 | |
---|
| 354 | const std::string& _ConsoleCommand::getDescription() const |
---|
| 355 | { |
---|
| 356 | return GetLocalisation_noerror(this->description_); |
---|
| 357 | } |
---|
| 358 | |
---|
| 359 | _ConsoleCommand& _ConsoleCommand::descriptionParam(unsigned int param, const std::string& description) |
---|
| 360 | { |
---|
| 361 | if (param < MAX_FUNCTOR_ARGUMENTS) |
---|
| 362 | { |
---|
| 363 | this->descriptionParam_[param] = std::string("ConsoleCommandDescription::" + this->baseName_ + "::param" + multi_cast<std::string>(param)); |
---|
| 364 | AddLanguageEntry(this->descriptionParam_[param], description); |
---|
| 365 | } |
---|
| 366 | return *this; |
---|
| 367 | } |
---|
| 368 | |
---|
| 369 | const std::string& _ConsoleCommand::getDescriptionParam(unsigned int param) const |
---|
| 370 | { |
---|
| 371 | if (param < MAX_FUNCTOR_ARGUMENTS) |
---|
| 372 | return GetLocalisation_noerror(this->descriptionParam_[param]); |
---|
| 373 | |
---|
| 374 | return this->descriptionParam_[0]; |
---|
| 375 | } |
---|
| 376 | |
---|
| 377 | _ConsoleCommand& _ConsoleCommand::descriptionReturnvalue(const std::string& description) |
---|
| 378 | { |
---|
| 379 | this->descriptionReturnvalue_ = std::string("ConsoleCommandDescription::" + this->baseName_ + "::returnvalue"); |
---|
| 380 | AddLanguageEntry(this->descriptionReturnvalue_, description); |
---|
| 381 | return *this; |
---|
| 382 | } |
---|
| 383 | |
---|
| 384 | const std::string& _ConsoleCommand::getDescriptionReturnvalue(int param) const |
---|
| 385 | { |
---|
| 386 | return GetLocalisation_noerror(this->descriptionReturnvalue_); |
---|
| 387 | } |
---|
| 388 | |
---|
[7179] | 389 | /* static */ const _ConsoleCommand* _ConsoleCommand::getCommand(const std::string& group, const std::string& name, bool bPrintError) |
---|
| 390 | { |
---|
| 391 | std::map<std::string, std::map<std::string, _ConsoleCommand*> >::const_iterator it_group = _ConsoleCommand::getCommandMap().find(group); |
---|
| 392 | if (it_group != _ConsoleCommand::getCommandMap().end()) |
---|
| 393 | { |
---|
| 394 | std::map<std::string, _ConsoleCommand*>::const_iterator it_name = it_group->second.find(name); |
---|
| 395 | if (it_name != it_group->second.end()) |
---|
| 396 | { |
---|
| 397 | return it_name->second; |
---|
| 398 | } |
---|
| 399 | } |
---|
| 400 | if (bPrintError) |
---|
| 401 | { |
---|
| 402 | if (group == "") |
---|
[7198] | 403 | COUT(1) << "Error: Couldn't find console command with shortcut \"" << name << "\"" << std::endl; |
---|
[7179] | 404 | else |
---|
[7198] | 405 | COUT(1) << "Error: Couldn't find console command with group \"" << group << "\" and name \"" << name << "\"" << std::endl; |
---|
[7179] | 406 | } |
---|
| 407 | return 0; |
---|
| 408 | } |
---|
| 409 | |
---|
| 410 | /* static */ std::map<std::string, std::map<std::string, _ConsoleCommand*> >& _ConsoleCommand::getCommandMap() |
---|
| 411 | { |
---|
| 412 | static std::map<std::string, std::map<std::string, _ConsoleCommand*> > commandMap; |
---|
| 413 | return commandMap; |
---|
| 414 | } |
---|
| 415 | |
---|
| 416 | /* static */ void _ConsoleCommand::registerCommand(const std::string& group, const std::string& name, _ConsoleCommand* command) |
---|
| 417 | { |
---|
| 418 | if (name == "") |
---|
| 419 | return; |
---|
| 420 | |
---|
| 421 | if (_ConsoleCommand::getCommand(group, name) != 0) |
---|
| 422 | { |
---|
| 423 | if (group == "") |
---|
[7214] | 424 | COUT(2) << "Warning: A console command with shortcut \"" << name << "\" already exists." << std::endl; |
---|
[7179] | 425 | else |
---|
[7214] | 426 | COUT(2) << "Warning: A console command with name \"" << name << "\" already exists in group \"" << group << "\"." << std::endl; |
---|
[7179] | 427 | } |
---|
| 428 | else |
---|
| 429 | { |
---|
| 430 | _ConsoleCommand::getCommandMap()[group][name] = command; |
---|
| 431 | } |
---|
| 432 | } |
---|
[7214] | 433 | |
---|
| 434 | /* static */ void _ConsoleCommand::unregisterCommand(_ConsoleCommand* command) |
---|
| 435 | { |
---|
| 436 | for (std::map<std::string, std::map<std::string, _ConsoleCommand*> >::iterator it_group = _ConsoleCommand::getCommandMap().begin(); it_group != _ConsoleCommand::getCommandMap().end(); ) |
---|
| 437 | { |
---|
| 438 | for (std::map<std::string, _ConsoleCommand*>::iterator it_name = it_group->second.begin(); it_name != it_group->second.end(); ) |
---|
| 439 | { |
---|
| 440 | if (it_name->second == command) |
---|
| 441 | it_group->second.erase(it_name++); |
---|
| 442 | else |
---|
| 443 | ++it_name; |
---|
| 444 | } |
---|
| 445 | |
---|
| 446 | if (it_group->second.empty()) |
---|
| 447 | _ConsoleCommand::getCommandMap().erase(it_group++); |
---|
| 448 | else |
---|
| 449 | ++it_group; |
---|
| 450 | } |
---|
| 451 | } |
---|
[7216] | 452 | |
---|
| 453 | /* static */ void _ConsoleCommand::destroyAll() |
---|
| 454 | { |
---|
| 455 | while (!_ConsoleCommand::getCommandMap().empty() && !_ConsoleCommand::getCommandMap().begin().empty()) |
---|
| 456 | _ConsoleCommand::getCommandMap().begin().erase(_ConsoleCommand::getCommandMap().begin().begin()); |
---|
| 457 | } |
---|
[7179] | 458 | } |
---|