Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 4, 2017, 4:17:59 PM (6 years ago)
Author:
kohlia
Message:

Position/velocity setting works now, relative script paths not, added test script

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/ScriptableController_HS17/src/orxonox/scriptablecontroller/scriptable_controller.cc

    r11606 r11638  
    6464}
    6565
     66void ScriptableController::registerMobileEntity(std::string id, MobileEntity *entity)
     67{
     68    this->mobileEntities_[id] = entity;
     69}
     70
    6671void ScriptableController::registerPawn(std::string id, Pawn *pawn)
    6772{
     
    124129}
    125130
     131MobileEntity *ScriptableController::getMobileEntityByID(std::string id) const
     132{
     133    if(id == "player" || id == "Player" || id == "PLAYER")
     134        return this->player_->getControllableEntity();
     135
     136    auto entity = this->mobileEntities_.find(id);
     137    return entity != this->mobileEntities_.end() ? entity->second : nullptr;
     138
     139}
     140
    126141Pawn *ScriptableController::getPawnByID(std::string id) const
    127142{
Note: See TracChangeset for help on using the changeset viewer.