Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9777 in orxonox.OLD for branches/new_class_id/src/lib/shell


Ignore:
Timestamp:
Sep 20, 2006, 9:49:13 AM (18 years ago)
Author:
bensch
Message:

calling static functions again out of the Shell

Location:
branches/new_class_id/src/lib/shell
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/new_class_id/src/lib/shell/shell_command.cc

    r9734 r9777  
    300300    if (sc != NULL)
    301301    {
    302       for(std::vector<BaseObject*>::const_iterator bo = boList.begin(); bo != boList.end(); ++bo)
    303       {
    304         PRINT(0)("Command '%s' on '%s::%s'\n", sc->getCName(), (*bo)->getClassCName(), (*bo)->getCName());
    305         (*sc->executor)((*bo), inputSplits.subSet(paramBegin));
    306       }
     302
     303      if(sc->executor->getType() == Executor<const SubString>::FunctionStatic )
     304      {
     305        PRINT(0)("Static Command '%s' of Class '%s' with parameters\n", sc->getCName(), sc->shellClass->getCName());
     306        (*sc->executor)(NULL, inputSplits.subSet(paramBegin));
     307      }
     308      else
     309        for(std::vector<BaseObject*>::const_iterator bo = boList.begin(); bo != boList.end(); ++bo)
     310        {
     311          PRINT(0)("Command '%s' on '%s::%s'\n", sc->getCName(), (*bo)->getClassCName(), (*bo)->getCName());
     312          (*sc->executor)((*bo), inputSplits.subSet(paramBegin));
     313        }
    307314      return true;
    308315    }
     
    377384    else
    378385    {
    379 //       if(this->completors[parameter] == NULL)
    380 //       delete this->completors[parameter];
    381 //       this->completors[parameter] = completorPlugin.clone();
     386      //       if(this->completors[parameter] == NULL)
     387      //       delete this->completors[parameter];
     388      //       this->completors[parameter] = completorPlugin.clone();
    382389    }
    383390    return this;
  • branches/new_class_id/src/lib/shell/shell_command.h

    r9769 r9777  
    5656   */
    5757#define SHELL_COMMAND_STATIC(command, class, function) \
    58            OrxShell::ShellCommand* shell_command_##class##_##command = OrxShell::ShellCommand::registerCommand(#command, #class, createExecutor<class, BaseObject>(function))
     58           OrxShell::ShellCommand* shell_command_##class##_##command = OrxShell::ShellCommand::registerCommand(#command, #class, createExecutor<class, BaseObject>(&class::function))
    5959
    6060
  • branches/new_class_id/src/lib/shell/some_shell_commands.cc

    r9721 r9777  
    2929
    3030#include "network_game_rules.h"
    31   SHELL_COMMAND(say, NetworkGameRules, shellSay)->setAlias("say");
     31SHELL_COMMAND(say, NetworkGameRules, shellSay)->setAlias("say");
    3232
    3333#include "player_stats.h"
    34   SHELL_COMMAND(nick, PlayerStats, shellNick)->setAlias("nick");
     34SHELL_COMMAND(nick, PlayerStats, shellNick)->setAlias("nick");
    3535
    3636// #include "class_list.h"
     
    4040
    4141#include "p_node.h"
    42   SHELL_COMMAND(debugNode, PNode, debugNode);
    43   SHELL_COMMAND(setPosition, PNode, setAbsCoor);
     42SHELL_COMMAND(debugNode, PNode, debugNode);
     43SHELL_COMMAND(setPosition, PNode, setAbsCoor);
    4444
    4545#include "render_2d.h"
    46   SHELL_COMMAND(toggleNodeVisibility, Render2D, toggleNodesVisibility);
     46SHELL_COMMAND(toggleNodeVisibility, Render2D, toggleNodesVisibility);
    4747
    4848
    4949#include "material.h"
    50   SHELL_COMMAND(setDiffuseTexture, Material, setDiffuseMap)
    51       ->defaultValues(MT_NULL, (int)GL_TEXTURE_2D)
    52       ->completionPlugin(0, CompletorFileSystem());
     50SHELL_COMMAND(setDiffuseTexture, Material, setDiffuseMap)
     51->defaultValues(MT_NULL, (int)GL_TEXTURE_2D)
     52->completionPlugin(0, CompletorFileSystem());
    5353
    5454#include "loading/resource_manager.h"
    5555SHELL_COMMAND(debug, ResourceManager, debug);
     56#include "loading/load_param_class_description.h"
     57OrxShell::ShellCommand* shell_command_LPCD_printAll =
     58  OrxShell::ShellCommand::registerCommand("printAll", "LoadParamClassDescription",
     59                                          new Executor2_static<LoadParamClassDescription, const SubString, const std::string&, bool>(&LoadParamClassDescription::printAll))
     60//SHELL_COMMAND_STATIC(print, LoadParamClassDescription, printAll)
     61->defaultValues(MT_NULL, true);
Note: See TracChangeset for help on using the changeset viewer.