Changeset 11638 for code/branches/ScriptableController_HS17/src/orxonox/scriptablecontroller/scriptable_controller.cc
- Timestamp:
- Dec 4, 2017, 4:17:59 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/ScriptableController_HS17/src/orxonox/scriptablecontroller/scriptable_controller.cc
r11606 r11638 64 64 } 65 65 66 void ScriptableController::registerMobileEntity(std::string id, MobileEntity *entity) 67 { 68 this->mobileEntities_[id] = entity; 69 } 70 66 71 void ScriptableController::registerPawn(std::string id, Pawn *pawn) 67 72 { … … 124 129 } 125 130 131 MobileEntity *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 126 141 Pawn *ScriptableController::getPawnByID(std::string id) const 127 142 {
Note: See TracChangeset
for help on using the changeset viewer.