Changeset 2435 for code/branches/presentation/src/orxonox/objects
- Timestamp:
- Dec 14, 2008, 1:42:17 AM (16 years ago)
- Location:
- code/branches/presentation/src/orxonox/objects
- Files:
-
- 38 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation/src/orxonox/objects/quest/AddQuest.cc
r2420 r2435 28 28 29 29 /** 30 @file AddQuest.cc30 @file 31 31 @brief Implementation of the AddQuest class. 32 32 */ … … 44 44 #include "Quest.h" 45 45 46 namespace orxonox {47 46 namespace orxonox 47 { 48 48 CreateFactory(AddQuest); 49 49 -
code/branches/presentation/src/orxonox/objects/quest/AddQuest.h
r2420 r2435 28 28 29 29 /** 30 @file AddQuest.h30 @file 31 31 @brief Definition of the AddQuest class. 32 32 */ … … 42 42 #include "ChangeQuestStatus.h" 43 43 44 namespace orxonox {45 44 namespace orxonox 45 { 46 46 /** 47 47 @brief -
code/branches/presentation/src/orxonox/objects/quest/AddQuestHint.cc
r2420 r2435 28 28 29 29 /** 30 @file AddQuestHint.cc30 @file 31 31 @brief Implementation of the AddQuestHint class. 32 32 */ … … 43 43 #include "QuestHint.h" 44 44 45 namespace orxonox {46 45 namespace orxonox 46 { 47 47 CreateFactory(AddQuestHint); 48 48 -
code/branches/presentation/src/orxonox/objects/quest/AddQuestHint.h
r2420 r2435 28 28 29 29 /** 30 @file AddQuestHint.h30 @file 31 31 @brief Definition of the AddQuestHint class. 32 32 */ … … 41 41 #include "QuestEffect.h" 42 42 43 namespace orxonox {44 43 namespace orxonox 44 { 45 45 /** 46 46 @brief -
code/branches/presentation/src/orxonox/objects/quest/AddReward.cc
r2420 r2435 28 28 29 29 /** 30 @file AddReward.cc30 @file 31 31 @brief Implementation of the AddReward class. 32 32 */ … … 40 40 #include "Rewardable.h" 41 41 42 namespace orxonox {43 42 namespace orxonox 43 { 44 44 CreateFactory(AddReward); 45 45 -
code/branches/presentation/src/orxonox/objects/quest/AddReward.h
r2420 r2435 28 28 29 29 /** 30 @file AddReward.h30 @file 31 31 @brief Definition of the AddReward class. 32 32 */ … … 42 42 #include "QuestEffect.h" 43 43 44 namespace orxonox {45 44 namespace orxonox 45 { 46 46 /** 47 47 @brief -
code/branches/presentation/src/orxonox/objects/quest/ChangeQuestStatus.cc
r2420 r2435 28 28 29 29 /** 30 @file ChangeQuestStatus.cc30 @file 31 31 @brief Implementation of the ChangeQuestStatus class. 32 32 */ … … 39 39 #include "QuestItem.h" 40 40 41 namespace orxonox {42 41 namespace orxonox 42 { 43 43 /** 44 44 @brief -
code/branches/presentation/src/orxonox/objects/quest/ChangeQuestStatus.h
r2420 r2435 28 28 29 29 /** 30 @file ChangeQuestStatus.h30 @file 31 31 @brief Definition of the ChangeQuestStatus class. 32 32 */ … … 42 42 #include "QuestEffect.h" 43 43 44 namespace orxonox {45 44 namespace orxonox 45 { 46 46 /** 47 47 @brief -
code/branches/presentation/src/orxonox/objects/quest/CompleteQuest.cc
r2420 r2435 28 28 29 29 /** 30 @file CompleteQuest.cc30 @file 31 31 @brief Implementation of the CompleteQuest class. 32 32 */ … … 42 42 #include "Quest.h" 43 43 44 namespace orxonox {45 44 namespace orxonox 45 { 46 46 CreateFactory(CompleteQuest); 47 47 -
code/branches/presentation/src/orxonox/objects/quest/CompleteQuest.h
r2420 r2435 28 28 29 29 /** 30 @file CompleteQuest.h30 @file 31 31 @brief Definition of the CompleteQuest class. 32 32 */ … … 42 42 #include "ChangeQuestStatus.h" 43 43 44 namespace orxonox {45 44 namespace orxonox 45 { 46 46 /** 47 47 @brief -
code/branches/presentation/src/orxonox/objects/quest/FailQuest.cc
r2420 r2435 28 28 29 29 /** 30 @file FailQuest.cc30 @file 31 31 @brief Implementation of the FailQuest class. 32 32 */ … … 42 42 #include "Quest.h" 43 43 44 namespace orxonox {45 44 namespace orxonox 45 { 46 46 CreateFactory(FailQuest); 47 47 -
code/branches/presentation/src/orxonox/objects/quest/FailQuest.h
r2420 r2435 28 28 29 29 /** 30 @file FailQuest.h30 @file 31 31 @brief Definition of the FailQuest class. 32 32 */ … … 42 42 #include "ChangeQuestStatus.h" 43 43 44 namespace orxonox {45 44 namespace orxonox 45 { 46 46 /** 47 47 @brief -
code/branches/presentation/src/orxonox/objects/quest/GlobalQuest.cc
r2420 r2435 28 28 29 29 /** 30 @file GlobalQuest.cc30 @file 31 31 @brief Implementation of the GlobalQuest class. 32 32 */ … … 42 42 #include "QuestEffect.h" 43 43 44 namespace orxonox {45 44 namespace orxonox 45 { 46 46 CreateFactory(GlobalQuest); 47 47 -
code/branches/presentation/src/orxonox/objects/quest/GlobalQuest.h
r2420 r2435 28 28 29 29 /** 30 @file GlobalQuest.h30 @file 31 31 @brief Definition of the GlobalQuest class. 32 32 */ … … 43 43 #include "Quest.h" 44 44 45 namespace orxonox {46 45 namespace orxonox 46 { 47 47 /** 48 48 @brief -
code/branches/presentation/src/orxonox/objects/quest/LocalQuest.cc
r2420 r2435 28 28 29 29 /** 30 @file LocalQuest.cc30 @file 31 31 @brief Implementation of the LocalQuest class. 32 32 */ … … 42 42 #include "QuestEffect.h" 43 43 44 namespace orxonox {45 44 namespace orxonox 45 { 46 46 CreateFactory(LocalQuest); 47 47 -
code/branches/presentation/src/orxonox/objects/quest/LocalQuest.h
r2420 r2435 28 28 29 29 /** 30 @file LocalQuest.h30 @file 31 31 @brief Definition of the LocalQuest class. 32 32 */ … … 43 43 #include "Quest.h" 44 44 45 namespace orxonox {46 45 namespace orxonox 46 { 47 47 /** 48 48 @brief -
code/branches/presentation/src/orxonox/objects/quest/Quest.cc
r2420 r2435 28 28 29 29 /** 30 @file Quest.cc30 @file 31 31 @brief Implementation of the Quest class. 32 32 */ … … 44 44 #include "QuestListener.h" 45 45 46 namespace orxonox {47 46 namespace orxonox 47 { 48 48 /** 49 49 @brief -
code/branches/presentation/src/orxonox/objects/quest/Quest.h
r2420 r2435 28 28 29 29 /** 30 @file Quest.h30 @file 31 31 @brief Definition of the Quest class. 32 32 The Quest is the parent class of LocalQuest and GlobalQuest. … … 45 45 #include "QuestItem.h" 46 46 47 namespace questStatus47 namespace orxonox 48 48 { 49 namespace questStatus 50 { 49 51 50 //!Different states of a Quest.51 enum Enum52 {53 inactive,54 active,55 failed,56 completed57 };52 //!Different states of a Quest. 53 enum Enum 54 { 55 inactive, 56 active, 57 failed, 58 completed 59 }; 58 60 59 } 60 61 namespace orxonox { 61 } 62 62 63 63 /** -
code/branches/presentation/src/orxonox/objects/quest/QuestDescription.cc
r2420 r2435 28 28 29 29 /** 30 @file QuestDescription.cc30 @file 31 31 @brief Implementation of the QuestDescription class. 32 32 */ … … 39 39 #include "orxonox/overlays/notifications/Notification.h" 40 40 41 namespace orxonox {42 41 namespace orxonox 42 { 43 43 CreateFactory(QuestDescription); 44 44 … … 128 128 } 129 129 130 Notification* notification = new Notification( message, title, 30);130 Notification* notification = new Notification(0, message, title, 30); 131 131 notification->send(); 132 132 return true; -
code/branches/presentation/src/orxonox/objects/quest/QuestDescription.h
r2420 r2435 28 28 29 29 /** 30 @file QuestDescription.h30 @file 31 31 @brief Definition of the QuestDescription class. 32 32 */ … … 42 42 #include "core/XMLPort.h" 43 43 44 namespace orxonox {45 44 namespace orxonox 45 { 46 46 /** 47 47 @brief … … 55 55 Damian 'Mozork' Frick 56 56 */ 57 class _OrxonoxExport QuestDescription : public BaseObject {58 57 class _OrxonoxExport QuestDescription : public BaseObject 58 { 59 59 public: 60 60 QuestDescription(BaseObject* creator); -
code/branches/presentation/src/orxonox/objects/quest/QuestEffect.cc
r2420 r2435 28 28 29 29 /** 30 @file QuestEffect.cc30 @file 31 31 @brief Implementation of the QuestEffect class. 32 32 */ … … 39 39 #include "orxonox/objects/infos/PlayerInfo.h" 40 40 41 namespace orxonox {42 41 namespace orxonox 42 { 43 43 /** 44 44 @brief -
code/branches/presentation/src/orxonox/objects/quest/QuestEffect.h
r2420 r2435 28 28 29 29 /** 30 @file QuestEffect.h30 @file 31 31 @brief Definition of the QuestEffect class. 32 32 */ … … 41 41 #include "core/BaseObject.h" 42 42 43 namespace orxonox {44 43 namespace orxonox 44 { 45 45 /** 46 46 @brief -
code/branches/presentation/src/orxonox/objects/quest/QuestEffectBeacon.cc
r2385 r2435 28 28 29 29 /** 30 @file QuestEffectBeacon.cc30 @file 31 31 @brief Implementation of the QuestEffectBeacon class. 32 32 */ … … 45 45 #include "QuestEffect.h" 46 46 47 namespace orxonox {48 47 namespace orxonox 48 { 49 49 CreateFactory(QuestEffectBeacon); 50 50 … … 58 58 59 59 this->status_ = QuestEffectBeaconStatus::active; 60 this->times_ = INFINITE ;60 this->times_ = INFINITE_TIME; 61 61 } 62 62 … … 186 186 return false; 187 187 } 188 if(this->getTimes() == INFINITE ) //!< If times is infinity the QuestEffectBeacon can be executed an infinite number fo times.188 if(this->getTimes() == INFINITE_TIME) //!< If times is infinity the QuestEffectBeacon can be executed an infinite number fo times. 189 189 { 190 190 return true; … … 212 212 bool QuestEffectBeacon::setTimes(const int & n) 213 213 { 214 if(n < 0 && n != INFINITE )214 if(n < 0 && n != INFINITE_TIME) 215 215 { 216 216 return false; -
code/branches/presentation/src/orxonox/objects/quest/QuestEffectBeacon.h
r2385 r2435 28 28 29 29 /** 30 @file QuestEffectBeacon.h30 @file 31 31 @brief Definition of the QuestEffectBeacon class. 32 32 */ … … 39 39 #include "orxonox/objects/worldentities/PositionableEntity.h" 40 40 41 namespace QuestEffectBeaconStatus41 namespace orxonox 42 42 { 43 namespace QuestEffectBeaconStatus 44 { 43 45 44 //! The status of the beacon, can be either active or inactive.45 enum Enum46 {47 inactive,48 active49 };46 //! The status of the beacon, can be either active or inactive. 47 enum Enum 48 { 49 inactive, 50 active 51 }; 50 52 51 } 52 53 namespace orxonox { 53 } 54 54 55 55 /** … … 112 112 113 113 private: 114 static const int INFINITE = -1; //!< Constant to avoid using magic numbers.114 static const int INFINITE_TIME = -1; //!< Constant to avoid using magic numbers. 115 115 116 116 std::list<QuestEffect*> effects_; //!< The list of QuestEffects to be invoked on the executing player. -
code/branches/presentation/src/orxonox/objects/quest/QuestHint.cc
r2420 r2435 28 28 29 29 /** 30 @file QuestHint.cc30 @file 31 31 @brief Implementation of the QuestHint class. 32 32 */ … … 43 43 #include "Quest.h" 44 44 45 namespace orxonox {46 45 namespace orxonox 46 { 47 47 CreateFactory(QuestHint); 48 48 -
code/branches/presentation/src/orxonox/objects/quest/QuestHint.h
r2420 r2435 28 28 29 29 /** 30 @file QuestHint.h30 @file 31 31 @brief Definition of the QuestHint class. 32 32 */ … … 43 43 #include "QuestItem.h" 44 44 45 namespace questHintStatus46 {47 48 //! The state of the hint.49 enum Enum50 {51 inactive,52 active53 };54 55 }56 57 45 namespace orxonox 58 46 { 47 namespace questHintStatus 48 { 49 50 //! The state of the hint. 51 enum Enum 52 { 53 inactive, 54 active 55 }; 56 57 } 59 58 60 59 /** -
code/branches/presentation/src/orxonox/objects/quest/QuestItem.cc
r2420 r2435 28 28 29 29 /** 30 @file QuestItem.cc30 @file 31 31 @brief Implementation of the QuestItem class. 32 32 */ … … 39 39 #include "QuestDescription.h" 40 40 41 namespace orxonox {42 41 namespace orxonox 42 { 43 43 /** 44 44 @brief -
code/branches/presentation/src/orxonox/objects/quest/QuestItem.h
r2420 r2435 28 28 29 29 /** 30 @file QuestItem.h30 @file 31 31 @brief Definition of the QuestItem class. 32 32 The QuestItem is the parent class of Quest and QuestHint. … … 44 44 #include "core/XMLPort.h" 45 45 46 namespace orxonox { 47 48 46 namespace orxonox 47 { 49 48 /** 50 49 @brief -
code/branches/presentation/src/orxonox/objects/quest/QuestListener.cc
r2385 r2435 28 28 29 29 /** 30 @file QuestListener.cc30 @file 31 31 @brief Implementation of the QuestListener class. 32 32 */ … … 42 42 #include "QuestManager.h" 43 43 44 namespace orxonox {45 44 namespace orxonox 45 { 46 46 CreateFactory(QuestListener); 47 47 … … 152 152 { 153 153 COUT(2) << "QuestListener with invalid mode '" << mode << "' created. Mode set to 'all'." << std::endl; 154 155 154 this->mode_ = questListenerMode::all; 155 return false; 156 156 } 157 157 … … 186 186 { 187 187 COUT(1) << "An unforseen, never to happen, Error has occured. This is impossible!" << std::endl; 188 188 return ""; 189 189 } 190 190 } -
code/branches/presentation/src/orxonox/objects/quest/QuestListener.h
r2385 r2435 28 28 29 29 /** 30 @file QuestListener.h30 @file 31 31 @brief Definition of the QuestListener class. 32 32 */ … … 44 44 #include "Quest.h" 45 45 46 namespace questListenerMode46 namespace orxonox 47 47 { 48 namespace questListenerMode 49 { 48 50 49 //! The mode of the QuestListener.50 enum Enum51 {52 all,53 start,54 fail,55 complete56 };51 //! The mode of the QuestListener. 52 enum Enum 53 { 54 all, 55 start, 56 fail, 57 complete 58 }; 57 59 58 } 59 60 namespace orxonox { 60 } 61 61 62 62 /** … … 75 75 </BaseObject> 76 76 @author 77 77 Damian 'Mozork' Frick 78 78 */ 79 79 class _OrxonoxExport QuestListener : public BaseObject 80 80 { 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 81 public: 82 QuestListener(BaseObject* creator); 83 virtual ~QuestListener(); 84 85 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a QuestListener object through XML. 86 87 static void advertiseStatusChange(std::list<QuestListener*> & listeners, const std::string & status); //!< Makes all QuestListener in the list aware that a certain status change has occured. 88 89 bool setQuestId(const std::string & id); //!< Sets the questId of the Quest the QuestListener reacts to. 90 bool setMode(const std::string & mode); //!< Sets the mode of the QuestListener. 91 92 const std::string getMode(void); //!< Get the mode of the QuestListener. 93 94 /** 95 @brief Get the questId of the Quest the QuestListener reacts to. 96 @return Returns the questId of the Quest the QuestListener reacts to. 97 */ 98 inline const std::string & getQuestId(void) 99 99 { return this->quest_->getId(); } 100 101 102 103 104 105 100 101 bool execute(void); //!< Executes the QuestListener, resp. fires an Event. 102 103 private: 104 questListenerMode::Enum mode_; //!< The mode of the QuestListener. 105 Quest* quest_; //!< A pointer to the Quest the QuestListener is reacting to. 106 106 107 107 }; -
code/branches/presentation/src/orxonox/objects/quest/QuestManager.cc
r2420 r2435 28 28 29 29 /** 30 @file QuestManager.cc30 @file 31 31 @brief Implementation of the QuestManager class. 32 32 */ … … 41 41 #include "QuestHint.h" 42 42 43 namespace orxonox {44 43 namespace orxonox 44 { 45 45 //! All Quests registered by their id's. 46 46 std::map<std::string, Quest*> QuestManager::questMap_s; -
code/branches/presentation/src/orxonox/objects/quest/QuestManager.h
r2420 r2435 28 28 29 29 /** 30 @file QuestManager.h30 @file 31 31 @brief Definition of the QuestManager class. 32 32 */ … … 42 42 #include "core/BaseObject.h" 43 43 44 namespace orxonox {45 44 namespace orxonox 45 { 46 46 /** 47 47 @brief -
code/branches/presentation/src/orxonox/objects/quest/Rewardable.cc
r2420 r2435 28 28 29 29 /** 30 @file Rewardable.cc30 @file 31 31 @brief Implementation of the Rewardable class. 32 32 */ … … 37 37 #include "core/CoreIncludes.h" 38 38 39 namespace orxonox {40 39 namespace orxonox 40 { 41 41 /** 42 42 @brief -
code/branches/presentation/src/orxonox/objects/quest/Rewardable.h
r2420 r2435 28 28 29 29 /** 30 @file Rewardable.h30 @file 31 31 @brief Definition of the Rewardable class. 32 32 */ … … 39 39 #include "core/BaseObject.h" 40 40 41 namespace orxonox {42 41 namespace orxonox 42 { 43 43 /** 44 44 @brief … … 51 51 class _OrxonoxExport Rewardable : public BaseObject 52 52 { 53 54 53 public: 55 54 Rewardable(BaseObject* creator); -
code/branches/presentation/src/orxonox/objects/worldentities/Planet.cc
r2420 r2435 27 27 */ 28 28 29 30 29 #include "OrxonoxStableHeaders.h" 31 30 #include "Planet.h" 32 31 33 #include "tinyxml/tinyxml.h"34 #include "core/CoreIncludes.h"35 #include "GraphicsEngine.h"36 #include "core/XMLPort.h"37 #include "CameraManager.h"38 #include "objects/Scene.h"39 #include "Camera.h"40 32 #include <math.h> 41 33 … … 45 37 #include <OgreMeshManager.h> 46 38 39 #include "core/CoreIncludes.h" 40 #include "core/XMLPort.h" 41 #include "objects/Scene.h" 42 #include "CameraManager.h" 43 #include "Camera.h" 44 #include "GraphicsEngine.h" 47 45 48 46 namespace orxonox … … 67 65 this->getNode()->detachObject(this->mesh_.getEntity()); 68 66 } 69 67 70 68 void Planet::tick(float dt) 71 69 { 72 70 if(!this->isVisible()) 73 71 return; 74 72 75 73 Camera* activeCamera = CameraManager::getInstance().getActiveCamera(); 76 77 74 if(activeCamera) 75 { 78 76 Real distance = this->getPosition().distance( activeCamera->getWorldPosition() ); 79 // COUT(2) << distance << std::endl;77 // COUT(2) << distance << std::endl; 80 78 Real planetRadius = this->getScale(); 81 79 82 80 Real newScale = 2 * distance / sqrt(distance*distance - planetRadius*planetRadius); 83 81 Real tempTest = newScale*(1+Real(this->atmosphereSize)/Real(this->imageSize)); 84 82 newScale = tempTest; 85 83 86 84 this->billboard_.getBillboardSet()->setDefaultDimensions(newScale, newScale); 87 88 85 } 86 89 87 SUPER(Planet, tick, dt); 90 88 } 91 92 void Planet::init() {93 89 90 void Planet::init() 91 { 94 92 Real scaleFactor = this->getScale(); 95 93 96 94 this->distList.push_back(10.0*scaleFactor); 97 95 this->distList.push_back(19.0*scaleFactor); … … 104 102 this->distList.push_back(54.0*scaleFactor); 105 103 this->distList.push_back(55.0*scaleFactor); 106 104 107 105 Real reductionValue = 0.2; 108 106 109 107 this->mesh_.getEntity()->getMesh()->generateLodLevels(distList, Ogre::ProgressiveMesh::VRQ_PROPORTIONAL, reductionValue); 110 108 billboard_.setBillboardSet(this->getScene()->getSceneManager(), this->atmosphere_, Vector3(0,0,0)); 111 109 112 110 this->getNode()->attachObject(this->billboard_.getBillboardSet()); 113 111 this->billboard_.getBillboardSet()->setUseAccurateFacing(true); … … 116 114 this->mesh_.setCastShadows(true); 117 115 } 118 116 119 117 void Planet::changedMesh() 120 118 { … … 147 145 { 148 146 SUPER(Planet, XMLPort, xmlelement, mode); 149 147 150 148 XMLPortParam(Planet, "atmosphere", setAtmosphere, getAtmosphere, xmlelement, mode).defaultValues("planet/Atmosphere"); 151 149 XMLPortParam(Planet, "atmospheresize", setAtmosphereSize, getAtmosphereSize, xmlelement,mode); … … 153 151 XMLPortParam(Planet, "mesh", setMeshSource, getMeshSource, xmlelement, mode); 154 152 XMLPortParam(Planet, "shadow", setCastShadows, getCastShadows, xmlelement, mode).defaultValues(true); 155 156 153 } 157 154 158 void Planet::registerVariables(){ 155 void Planet::registerVariables() 156 { 159 157 registerVariable(this->atmosphere_, variableDirection::toclient); 160 158 registerVariable(this->meshSrc_, variableDirection::toclient, new NetworkCallback<Planet>(this, &Planet::changedMesh)); … … 168 166 SUPER(Planet, changedVisibility); 169 167 if (this->isInitialized()) 168 { 170 169 this->mesh_.setVisible(this->isVisible()); 171 170 this->billboard_.setVisible(this->isVisible()); 171 } 172 172 } 173 173 } -
code/branches/presentation/src/orxonox/objects/worldentities/Planet.h
r2420 r2435 29 29 #ifndef _Planet_H__ 30 30 #define _Planet_H__ 31 #include "tools/BillboardSet.h" 31 32 32 #include "OrxonoxPrereqs.h" 33 33 34 #include "tools/BillboardSet.h" 35 #include "tools/Mesh.h" 34 36 #include "MovableEntity.h" 35 #include "tools/Mesh.h"36 37 #include "objects/Tickable.h" 37 38 38 39 namespace orxonox 39 40 { 40 41 41 class _OrxonoxExport Planet : public MovableEntity 42 42 { -
code/branches/presentation/src/orxonox/objects/worldentities/triggers/PlayerTrigger.cc
r2262 r2435 28 28 29 29 /** 30 @file PlayerTrigger.cc30 @file 31 31 @brief 32 32 Implementation of the PlayerTrigger class. 33 33 */ 34 34 … … 38 38 #include "core/CoreIncludes.h" 39 39 40 namespace orxonox {41 40 namespace orxonox 41 { 42 42 /** 43 43 @brief … … 47 47 { 48 48 RegisterObject(PlayerTrigger); 49 49 50 50 this->player_ = NULL; 51 51 this->isForPlayer_ = true; 52 52 } 53 53 54 54 /** 55 55 @brief … … 66 66 void PlayerTrigger::XMLPort(Element& xmlelement, XMLPort::Mode mode) 67 67 { 68 68 SUPER(PlayerTrigger, XMLPort, xmlelement, mode); 69 69 } 70 71 70 } -
code/branches/presentation/src/orxonox/objects/worldentities/triggers/PlayerTrigger.h
r2262 r2435 28 28 29 29 /** 30 @file PlayerTrigger.h30 @file 31 31 @brief 32 32 Definition of the PlayerTrigger class. 33 33 */ 34 34 … … 40 40 #include "Trigger.h" 41 41 42 namespace orxonox {43 42 namespace orxonox 43 { 44 44 /** 45 45 @brief … … 50 50 class _OrxonoxExport PlayerTrigger : public Trigger 51 51 { 52 public: 53 PlayerTrigger(BaseObject* creator); 54 virtual ~PlayerTrigger(); 55 56 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a PlayerTrigger object through XML. 52 public: 53 PlayerTrigger(BaseObject* creator); 54 virtual ~PlayerTrigger(); 55 56 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a PlayerTrigger object through XML. 57 58 /** 59 @brief Returns the player that triggered the PlayerTrigger. 60 @return Returns a pointer to the ControllableEntity that triggered the PlayerTrigger. 61 */ 62 inline ControllableEntity* getTriggeringPlayer(void) const 63 { return this->player_; } 64 65 /** 66 @brief Checks whether the PlayerTrigger normally returns a ControllableEntity. 67 @return Returns true if the PlayerTrigger normally returns a ControllableEntity. 68 */ 69 inline bool isForPlayer(void) const 70 { return this->isForPlayer_; } 57 71 58 /** 59 @brief Returns the player that triggered the PlayerTrigger. 60 @return Returns a pointer to the ControllableEntity that triggered the PlayerTrigger. 61 */ 62 inline ControllableEntity* getTriggeringPlayer(void) const 63 { return this->player_; } 64 65 /** 66 @brief Checks whether the PlayerTrigger normally returns a ControllableEntity. 67 @return Returns true if the PlayerTrigger normally returns a ControllableEntity. 68 */ 69 inline bool isForPlayer(void) const 70 { return this->isForPlayer_; } 71 72 protected: 73 virtual bool isTriggered(TriggerMode mode) = 0; 74 75 /** 76 @brief Set the player that triggered the PlayerTrigger. This is normally done by classes inheriting vom PlayerTrigger. 77 @param player A pointer to the ControllableEntity that triggered the PlayerTrigger. 78 */ 79 inline void setTriggeringPlayer(ControllableEntity* player) 80 { this->player_ = player; } 72 protected: 73 virtual bool isTriggered(TriggerMode mode) = 0; 74 75 /** 76 @brief Set the player that triggered the PlayerTrigger. This is normally done by classes inheriting vom PlayerTrigger. 77 @param player A pointer to the ControllableEntity that triggered the PlayerTrigger. 78 */ 79 inline void setTriggeringPlayer(ControllableEntity* player) 80 { this->player_ = player; } 81 81 82 82 /** … … 84 84 @param isForPlayer Should be true when the PlayerTrigger schould be set to normally be triggered by ControllableEntities, false if not. 85 85 */ 86 87 88 89 90 91 92 86 inline void setForPlayer(bool isForPlayer) 87 { this->isForPlayer_ = isForPlayer; } 88 89 private: 90 ControllableEntity* player_; //!< The player that triggered the PlayerTrigger. 91 bool isForPlayer_; //!< Is true when the PlayerTrigger schould be set to normally be triggered by ControllableEntities. 92 93 93 }; 94 94
Note: See TracChangeset
for help on using the changeset viewer.