- Timestamp:
- Feb 19, 2018, 10:32:12 PM (7 years ago)
- Location:
- code/branches/Presentation_HS17_merge/src/orxonox/controllers
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/Presentation_HS17_merge/src/orxonox/controllers/ArrowController.cc
r11774 r11777 21 21 * 22 22 * Author: 23 * Oli Scheuss23 * jostoffe 24 24 * Co-authors: 25 * Damian 'Mozork' Frick25 * ... 26 26 * 27 27 */ … … 29 29 #include "ArrowController.h" 30 30 #include "HumanController.h" 31 #include "worldentities/ WorldEntity.h"32 33 #include " worldentities/Arrow.h"31 #include "worldentities/ControllableEntity.h" 32 33 #include "core/CoreIncludes.h" 34 34 #include "util/Math.h" 35 35 … … 39 39 RegisterClass(ArrowController); 40 40 41 42 43 /**44 @brief45 Constructor.46 */47 41 ArrowController::ArrowController(Context* context) : Controller(context) 48 42 { … … 52 46 this->currentGPSPoint_ = 0; 53 47 this->accuracy_ = 1000.0f; 48 } 54 49 55 arrow = nullptr; 50 ArrowController::~ArrowController() 51 { 52 for (WorldEntity* gpspoint : this->gpspoints_) 53 { 54 if(gpspoint) 55 gpspoint->destroy(); 56 } 56 57 57 for(Arrow* a: ObjectList<Arrow>()) 58 arrow = a; 58 } 59 59 60 assert(arrow != nullptr);61 this->setControllableEntity(arrow);62 63 orxout() << "constructor aufgerufen" << endl;64 }65 66 60 //Set the distance you need to reach before the next waypoint will be selected 67 61 void ArrowController::setAccuracy(float accuracy){ … … 85 79 return nullptr; 86 80 } 87 /**88 @brief89 Destructor.90 */91 92 ArrowController::~ArrowController()93 {94 for (WorldEntity* gpspoint : this->gpspoints_)95 {96 if(gpspoint)97 gpspoint->destroy();98 }99 100 }101 102 81 103 82 void ArrowController::XMLPort(Element& xmlelement, XMLPort::Mode mode) -
code/branches/Presentation_HS17_merge/src/orxonox/controllers/ArrowController.h
r11774 r11777 21 21 * 22 22 * Author: 23 * Oli Scheuss23 * jostoffe 24 24 * Co-authors: 25 * Damian 'Mozork' Frick25 * ... 26 26 * 27 27 */ … … 38 38 namespace orxonox 39 39 { 40 /**41 @brief42 Controller for the Arrow of the PPS tutorial.43 @author44 Oli Scheuss45 */46 40 class _OrxonoxExport ArrowController : public Controller, public Tickable 47 41 { … … 59 53 virtual void tick(float dt); //!< The controlling happens here. This method defines what the controller has to do each tick. 60 54 61 protected: 62 55 private: 63 56 std::vector<WeakPtr<WorldEntity>> gpspoints_; 64 57 size_t currentGPSPoint_; 65 58 float accuracy_; 66 WorldEntity* defaultGPSpoint_;67 68 private:69 Arrow *arrow;70 59 }; 71 60 }
Note: See TracChangeset
for help on using the changeset viewer.