- Timestamp:
- Apr 8, 2009, 12:36:08 AM (16 years ago)
- Location:
- code/branches/questsystem5
- Files:
-
- 2 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/questsystem5
- Property svn:mergeinfo changed
-
code/branches/questsystem5/src/orxonox/objects/controllers/AIController.cc
r2662 r2907 30 30 #include "AIController.h" 31 31 32 #include "core/ Core.h"32 #include "core/GameMode.h" 33 33 #include "core/CoreIncludes.h" 34 34 #include "core/Executor.h" … … 45 45 RegisterObject(AIController); 46 46 47 if ( Core::isMaster())47 if (GameMode::isMaster()) 48 48 this->actionTimer_.setTimer(ACTION_INTERVAL, true, this, createExecutor(createFunctor(&AIController::action))); 49 49 } -
code/branches/questsystem5/src/orxonox/objects/controllers/CMakeLists.txt
r2710 r2907 5 5 AIController.cc 6 6 ScriptController.cc 7 PongAI.cc 7 8 ) -
code/branches/questsystem5/src/orxonox/objects/controllers/Controller.cc
r2662 r2907 43 43 this->player_ = 0; 44 44 this->controllableEntity_ = 0; 45 this->hud_ = 0;46 this->bUpdateHUD_ = false;47 45 } 48 46 49 47 Controller::~Controller() 50 48 { 51 if (this->isInitialized() && this->hud_)52 delete this->hud_;53 }54 55 void Controller::changedControllableEntity()56 {57 if (this->bUpdateHUD_)58 {59 this->updateHUD();60 this->bUpdateHUD_ = false;61 }62 63 if (this->hud_)64 this->hud_->setOwner(this->getControllableEntity());65 }66 67 void Controller::updateHUD()68 {69 if (this->hud_)70 {71 delete this->hud_;72 this->hud_ = 0;73 }74 75 if (this->hudtemplate_ != "")76 {77 this->hud_ = new OverlayGroup(this);78 this->hud_->addTemplate(this->hudtemplate_);79 this->hud_->setOwner(this->getControllableEntity());80 }81 49 } 82 50 } -
code/branches/questsystem5/src/orxonox/objects/controllers/Controller.h
r2662 r2907 57 57 inline ControllableEntity* getControllableEntity() const 58 58 { return this->controllableEntity_; } 59 virtual void changedControllableEntity(); 60 61 inline void setHUDTemplate(const std::string& name) 62 { 63 if (name != this->hudtemplate_) 64 { 65 this->hudtemplate_ = name; 66 if (this->controllableEntity_) 67 this->updateHUD(); 68 else 69 this->bUpdateHUD_ = true; 70 } 71 } 72 inline const std::string& getHUDTemplate() const 73 { return this->hudtemplate_; } 74 75 inline OverlayGroup* getHUD() const 76 { return this->hud_; } 59 virtual void changedControllableEntity() {} 77 60 78 61 protected: 79 void updateHUD();80 81 62 PlayerInfo* player_; 82 63 ControllableEntity* controllableEntity_; 83 std::string hudtemplate_;84 OverlayGroup* hud_;85 bool bUpdateHUD_;86 64 }; 87 65 } -
code/branches/questsystem5/src/orxonox/objects/controllers/HumanController.cc
r2662 r2907 35 35 #include "objects/worldentities/pawns/Pawn.h" 36 36 #include "objects/gametypes/Gametype.h" 37 #include "objects/infos/PlayerInfo.h" 37 38 38 39 namespace orxonox … … 157 158 if (pawn) 158 159 pawn->kill(); 160 else if (HumanController::localController_s->player_) 161 HumanController::localController_s->player_->stopControl(HumanController::localController_s->controllableEntity_); 159 162 } 160 163 }
Note: See TracChangeset
for help on using the changeset viewer.