Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Sep 28, 2008, 7:10:08 PM (16 years ago)
Author:
rgrieder
Message:

TutorialShip should now do basic stuff.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/orxonox_tutorial/src/orxonox/objects/TutorialShip.cc

    r1852 r1855  
    4545namespace orxonox
    4646{
    47     SetConsoleCommand(TutorialShip, fire, true);
     47    SetConsoleCommand(TutorialShip, fire, true).keybindMode(KeybindMode::OnHold);
     48
     49    CreateFactory(TutorialShip);
    4850
    4951    TutorialShip::TutorialShip()
     
    5254
    5355        // reset variables
     56        this->hasSpecialEffects_ = false;
     57
     58        // set config values
     59        this->setConfigValues();
    5460    }
    5561
     
    6571    void TutorialShip::setConfigValues()
    6672    {
    67         //SetConfigValue(bInvertYAxis_, false).description("Set this to true for joystick-like mouse behaviour (mouse up = ship down).");
    68         //SetConfigValue(reloadTime_, 0.125).description("The reload time of the weapon in seconds");
    69         //SetConfigValue(testvector_, Vector3()).description("asdfblah");
     73        SetConfigValue(reloadTime_, 0.125).description("The reload time of the weapon in seconds");
    7074    }
    7175
    72     void TutorialShip::registerAllVariables()
    73     {
    74     }
     76    //void TutorialShip::registerAllVariables()
     77    //{
     78    //}
    7579   
    7680    /**
     
    8286    void TutorialShip::XMLPort(Element& xmlelement, XMLPort::Mode mode)
    8387    {
     88        XMLPortParam(TutorialShip, "specialEffects", setSpecialEffects, hasSpecialEffects, xmlelement, mode);
     89
     90        // Calls SpaceShip::XMLPort
    8491        SUPER(TutorialShip, XMLPort, xmlelement, mode);
     92    }
    8593
    86         //XMLPortParam(SpaceShip, "camera", setCamera, getCamera, xmlelement, mode);
     94    bool TutorialShip::hasSpecialEffects()
     95    {
     96        return this->hasSpecialEffects_;
     97    }
     98
     99    void TutorialShip::setSpecialEffects(bool value)
     100    {
     101        this->hasSpecialEffects_ = value;
     102    }
     103
     104    /**
     105        @brief Returns the weapon reload time. Used virtually by the base class.
     106    */
     107    float TutorialShip::getReloadTime()
     108    {
     109        return this->reloadTime_;
    87110    }
    88111
     
    95118    void TutorialShip::fire()
    96119    {
     120        SpaceShip::getLocalShip()->doFire();
    97121    }
    98122}
Note: See TracChangeset for help on using the changeset viewer.