Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 31, 2015, 3:51:08 PM (11 years ago)
Author:
landauf
Message:

made SpaceShip::engineList_ private again. moved function from ModularSpaceShip to SpaceShip and optimized it a little (neither iterator nor orxonox_casts are necessary here)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentationFS14/src/orxonox/worldentities/pawns/SpaceShip.cc

    r9667 r10211  
    342342    /**
    343343    @brief
     344        Looks for an attached Engine with a certain name.
     345    @param name
     346        The name of the engine to be returned.
     347    @return
     348        Pointer to the engine with the given name, or NULL if not found.
     349    */
     350    Engine* SpaceShip::getEngineByName(const std::string& name)
     351    {
     352        for(size_t i = 0; i < this->engineList_.size(); ++i)
     353            if(this->engineList_[i]->getName() == name)
     354                return this->engineList_[i];
     355
     356        orxout(internal_warning) << "Couldn't find Engine with name \"" << name << "\"." << endl;
     357        return NULL;
     358    }
     359
     360    /**
     361    @brief
    344362        Remove and destroy all Engines of the SpaceShip.
    345363    */
Note: See TracChangeset for help on using the changeset viewer.