Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 6, 2015, 10:40:54 PM (10 years ago)
Author:
landauf
Message:

removed hack

Location:
code/branches/core7/src/modules/towerdefense
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core7/src/modules/towerdefense/TowerDefense.cc

    r10348 r10350  
    9191namespace orxonox
    9292{
     93    static const std::string __CC_addTower_name  = "addTower";
     94    static const std::string __CC_upgradeTower_name = "upgradeTower";
     95
     96    SetConsoleCommand("TowerDefense", __CC_addTower_name,  &TowerDefense::addTower ).addShortcut().defaultValues(1);
     97    SetConsoleCommand("TowerDefense", __CC_upgradeTower_name, &TowerDefense::upgradeTower).addShortcut().defaultValues(0);
     98
    9399    RegisterUnloadableClass(TowerDefense);
    94100
     
    107113        //this->stats_ = new TowerDefensePlayerStats();
    108114
    109         /* Temporary hack to allow the player to add towers and upgrade them */
    110         this->dedicatedAddTower_ = new ConsoleCommand( "addTower", createExecutor( createFunctor(&TowerDefense::addTower, this) ) );
    111         this->dedicatedUpgradeTower_ = new ConsoleCommand( "upgradeTower", createExecutor( createFunctor(&TowerDefense::upgradeTower, this) ) );
     115        ModifyConsoleCommand(__CC_addTower_name).setObject(this);
     116        ModifyConsoleCommand(__CC_upgradeTower_name).setObject(this);
    112117    }
    113118
     
    117122        if (this->isInitialized())
    118123        {
    119             if( this->dedicatedAddTower_ )
    120                 delete this->dedicatedAddTower_;
     124            ModifyConsoleCommand(__CC_addTower_name).setObject(NULL);
     125            ModifyConsoleCommand(__CC_upgradeTower_name).setObject(NULL);
    121126        }
    122127    }
  • code/branches/core7/src/modules/towerdefense/TowerDefense.h

    r10258 r10350  
    8585
    8686        void upgradeTower(int x, int y);
    87         /* Part of a temporary hack to allow the player to add towers */
    88         ConsoleCommand* dedicatedAddTower_;
    89         ConsoleCommand* dedicatedUpgradeTower_;
    9087
    9188        //TODO: void spawnNewWave()
Note: See TracChangeset for help on using the changeset viewer.