Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 21, 2008, 1:33:42 AM (16 years ago)
Author:
landauf
Message:

big commit, but not much changes in code:

  • put CommandEvaluation into it's own .cc and .h files
  • put some basic ConsoleCommands into ConsoleCommandCompilation.cc and .h
  • created a new class, ConsoleCommand, inheriting from ExecutorStatic, implementing all command-related features that were located in the Executor until now (at the moment only accessLevel_, but more will come - from reto and me)
  • renamed ConsoleCommand-macros to SetConsoleCommand (all related macros were changed the same way)
  • added a new command named "killdelays", that kills all delayed commands. helpful to stop disco ;)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/console/src/core/Identifier.cc

    r1062 r1341  
    3737
    3838#include "Factory.h"
    39 #include "Executor.h"
     39#include "ConsoleCommand.h"
    4040#include "CommandExecutor.h"
    4141
     
    270270        @return The executor of the command
    271271    */
    272     ExecutorStatic& Identifier::addConsoleCommand(ExecutorStatic* executor, bool bCreateShortcut)
     272    ConsoleCommand& Identifier::addConsoleCommand(ConsoleCommand* command, bool bCreateShortcut)
    273273    {
    274274        this->bHasConsoleCommands_ = true;
    275         this->consoleCommands_[executor->getName()] = executor;
    276         this->consoleCommands_LC_[getLowercase(executor->getName())] = executor;
     275        this->consoleCommands_[command->getName()] = command;
     276        this->consoleCommands_LC_[getLowercase(command->getName())] = command;
    277277
    278278        if (bCreateShortcut)
    279             CommandExecutor::addConsoleCommandShortcut(executor);
    280 
    281         return (*executor);
     279            CommandExecutor::addConsoleCommandShortcut(command);
     280
     281        return (*command);
    282282    }
    283283
     
    287287        @return The executor of the requested console command
    288288    */
    289     ExecutorStatic* Identifier::getConsoleCommand(const std::string& name) const
    290     {
    291         std::map<std::string, ExecutorStatic*>::const_iterator it = this->consoleCommands_.find(name);
     289    ConsoleCommand* Identifier::getConsoleCommand(const std::string& name) const
     290    {
     291        std::map<std::string, ConsoleCommand*>::const_iterator it = this->consoleCommands_.find(name);
    292292        if (it != this->consoleCommands_.end())
    293293            return (*it).second;
     
    301301        @return The executor of the requested console command
    302302    */
    303     ExecutorStatic* Identifier::getLowercaseConsoleCommand(const std::string& name) const
    304     {
    305         std::map<std::string, ExecutorStatic*>::const_iterator it = this->consoleCommands_LC_.find(name);
     303    ConsoleCommand* Identifier::getLowercaseConsoleCommand(const std::string& name) const
     304    {
     305        std::map<std::string, ConsoleCommand*>::const_iterator it = this->consoleCommands_LC_.find(name);
    306306        if (it != this->consoleCommands_LC_.end())
    307307            return (*it).second;
Note: See TracChangeset for help on using the changeset viewer.