Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 26, 2016, 4:53:34 PM (8 years ago)
Author:
fvultier
Message:

merged discharger, thats the last one

Location:
code/branches/presentationFS16
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentationFS16

  • code/branches/presentationFS16/src/orxonox/controllers/HumanController.cc

    r11071 r11208  
    4040namespace orxonox
    4141{
    42     extern const std::string __CC_fire_name = "fire";
     42    extern const std::string __CC_push_name = "push";
    4343    extern const std::string __CC_suicide_name = "suicide";
     44    extern const std::string __CC_release_name = "release";
    4445
    4546    SetConsoleCommand("HumanController", "moveFrontBack",          &HumanController::moveFrontBack ).addShortcut().setAsInputCommand();
     
    5152    SetConsoleCommand("HumanController", "toggleFormationFlight",  &HumanController::toggleFormationFlight).addShortcut().keybindMode(KeybindMode::OnPress);
    5253    SetConsoleCommand("HumanController", "FFChangeMode",           &HumanController::FFChangeMode).addShortcut().keybindMode(KeybindMode::OnPress);
    53     SetConsoleCommand("HumanController", __CC_fire_name,           &HumanController::fire          ).addShortcut().keybindMode(KeybindMode::OnHold);
     54    SetConsoleCommand("HumanController", __CC_push_name,           &HumanController::push          ).addShortcut().keybindMode(KeybindMode::OnHold);
     55    SetConsoleCommand("HumanController", __CC_release_name,        &HumanController::release       ).addShortcut().keybindMode(KeybindMode::OnRelease);
    5456    SetConsoleCommand("HumanController", "reload",                 &HumanController::reload        ).addShortcut();
    5557    SetConsoleCommand("HumanController", "boost",                  &HumanController::boost         ).addShortcut().setAsInputCommand().keybindMode(KeybindMode::OnPressAndRelease);
     
    155157    }
    156158
    157     void HumanController::fire(unsigned int firemode)
    158     {
    159         if (HumanController::localController_s)
    160             HumanController::localController_s->doFire(firemode);
    161     }
    162 
    163     void HumanController::doFire(unsigned int firemode)
    164     {
    165         if (HumanController::localController_s && HumanController::localController_s->controllableEntity_)
    166         {
    167             HumanController::localController_s->controllableEntity_->fire(firemode);
     159    void HumanController::push(unsigned int firemode)
     160    {
     161        if (HumanController::localController_s)
     162            HumanController::localController_s->doPush(firemode);
     163    }
     164
     165    void HumanController::doPush(unsigned int firemode)
     166    {
     167        if (HumanController::localController_s && HumanController::localController_s->controllableEntity_)
     168        {
     169            HumanController::localController_s->controllableEntity_->push(firemode);
    168170            //if human fires, set slaves free. See FormationController::forceFreeSlaves()
     171            if (HumanController::localController_s->state_==MASTER && HumanController::localController_s->formationMode_ == NORMAL)
     172            {
     173                HumanController::localController_s->forceFreeSlaves();
     174            }
     175        }
     176    }
     177
     178    void HumanController::release(unsigned int firemode)
     179    {
     180        if (HumanController::localController_s)
     181            HumanController::localController_s->doRelease(firemode);
     182    }
     183
     184    void HumanController::doRelease(unsigned int firemode)
     185    {
     186        if (HumanController::localController_s && HumanController::localController_s->controllableEntity_)
     187        {
     188            HumanController::localController_s->controllableEntity_->release(firemode);
     189            //if human releases, set slaves free. See FormationController::forceFreeSlaves()
    169190            if (HumanController::localController_s->state_==MASTER && HumanController::localController_s->formationMode_ == NORMAL)
    170191            {
Note: See TracChangeset for help on using the changeset viewer.