Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 31, 2015, 3:51:08 PM (9 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/ModularSpaceShip.cc

    r10073 r10211  
    316316    /**
    317317    @brief
    318         Looks for an attached Engine with a certain name.
    319     @param name
    320         The name of the engine to be returned.
    321     @return
    322         Pointer to the engine with the given name, or NULL if not found.
    323     */
    324     Engine* ModularSpaceShip::getEngineByName(std::string name)
    325     {
    326         for(std::vector<Engine*>::iterator it = this->engineList_.begin(); it != this->engineList_.end(); ++it)
    327         {
    328             if(orxonox_cast<Engine*>(*it)->getName() == name)
    329             {
    330                 return orxonox_cast<Engine*>(*it);
    331             }
    332         }
    333         orxout(internal_warning) << "Couldn't find Engine with name \"" << name << "\"." << endl;
    334         return NULL;
    335     }
    336 
    337     /**
    338     @brief
    339318        Detaches a child WorldEntity from this instance.
    340319    */
Note: See TracChangeset for help on using the changeset viewer.