Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5162 in orxonox.OLD for trunk


Ignore:
Timestamp:
Sep 5, 2005, 10:29:03 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: more elaborate and MUCH easier through Macro-definition

Location:
trunk/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/shell/shell.cc

    r5161 r5162  
    3232using namespace std;
    3333
    34 ShellCommandBase* tmp = ShellCommand<Shell>::registerCommand("clear", "Shell", &Shell::clear);
     34SHELL_COMMAND(clear, Shell, clear);
    3535
    3636/**
     
    7676  for (int i = 1; i < SDLK_LAST; i++)
    7777    evh->subscribe(this, ES_SHELL, i);
    78 
    79   //void ShellCommand<T>::registerCommand(const char* commandName, ClassID classID, T* object, void* functionPointer, unsigned int paramCount, ...)
    80 
    81 
    82 /*  ShellCommand<Shell>::registerCommand("testS", CL_SHELL, &Shell::testS);
    83   ShellCommand<Shell>::registerCommand("testI", CL_SHELL, &Shell::testI, 5);
    84   ShellCommand<Shell>::registerCommand("testB", CL_SHELL, &Shell::testB);
    85   ShellCommand<Shell>::registerCommand("testF", CL_SHELL, &Shell::testF);
    86   ShellCommand<Shell>::registerCommand("testSF", CL_SHELL, &Shell::testSF);*/
    8778}
    8879
  • trunk/src/lib/shell/shell_command.h

    r5161 r5162  
    2121// FORWARD DECLARATION
    2222template<class T> class tList;
     23
     24#define SHELL_COMMAND(command, class, function) \
     25        ShellCommand<class>* shell_command_##class##_##command = ShellCommand<class>::registerCommand(#command, #class, &class::function)
    2326
    2427
  • trunk/src/util/loading/factory.cc

    r5161 r5162  
    2020#include "game_loader.h"
    2121using namespace std;
     22
     23SHELL_COMMAND(create, Factory, fabricate);
     24
    2225
    2326/*  --------------------------------------------------
     
    7174  {
    7275    Factory::first = factory;
    73     ShellCommand<Factory>::registerCommand("create", "Factory", &Factory::fabricate);
    7476  }
    7577  else
  • trunk/src/util/loading/game_loader.cc

    r5161 r5162  
    3434
    3535
    36 GameLoader* GameLoader::singletonRef = 0;
     36SHELL_COMMAND(quit, GameLoader, stop);
     37
     38
     39GameLoader* GameLoader::singletonRef = NULL;
     40
    3741
    3842/**
     
    4448  this->setName("GameLoader");
    4549
    46   ShellCommand<GameLoader>::registerCommand("quit", "GameLoader", &GameLoader::stop);
    4750}
    4851
  • trunk/src/world_entities/player.cc

    r5155 r5162  
    114114  this->weaponMan->addWeapon(turret4, 2, 5);
    115115
    116 
    117 //  ShellCommand<Player>::registerCommand("init", CL_PLAYER, &Player::init);
    118116  //this->weaponMan->addWeapon(turret, 3, 0);
    119117
Note: See TracChangeset for help on using the changeset viewer.