Changeset 2193
- Timestamp:
- Nov 12, 2008, 2:20:51 PM (16 years ago)
- Location:
- code/branches/questsystem2/src/orxonox
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/questsystem2/src/orxonox/CMakeLists.txt
r2146 r2193 95 95 objects/worldentities/triggers/DistanceTrigger.cc 96 96 objects/worldentities/triggers/EventTrigger.cc 97 objects/worldentities/triggers/PlayerTrigger.cc 97 98 98 99 objects/worldentities/pawns/Spectator.cc -
code/branches/questsystem2/src/orxonox/OrxonoxPrereqs.h
r2146 r2193 128 128 class DistanceTrigger; 129 129 class EventTrigger; 130 class PlayerTrigger; 130 131 131 132 class WeaponSystem; -
code/branches/questsystem2/src/orxonox/objects/quest/QuestEffectBeacon.cc
r2191 r2193 32 32 #include "core/CoreIncludes.h" 33 33 #include "core/XMLPort.h" 34 #include "core/Event .h"34 #include "core/EventIncludes.h" 35 35 36 36 #include "orxonox/objects/worldentities/ControllableEntity.h" 37 #include "orxonox/objects/worldentities/triggers/ Trigger.h"37 #include "orxonox/objects/worldentities/triggers/PlayerTrigger.h" 38 38 #include "QuestEffect.h" 39 39 … … 64 64 } 65 65 66 void processEvent(Event& event)66 void QuestEffectBeacon::processEvent(Event& event) 67 67 { 68 //TDO. Resolve pseudo code. 69 //if(isControllableEntity(event.originator_)) 70 //{ 71 // SetEvent(BaseObject, "activity", execute, event); 72 //} 68 SetSubclassEvent(QuestEffectBeacon, "execute", execute, event, PlayerTrigger); 73 69 } 74 70 … … 150 146 } 151 147 152 bool QuestEffectBeacon::addTrigger( Trigger* trigger)148 bool QuestEffectBeacon::addTrigger(PlayerTrigger* trigger) 153 149 { 154 150 if(this->trigger_ != NULL) -
code/branches/questsystem2/src/orxonox/objects/quest/QuestEffectBeacon.h
r2191 r2193 77 77 int times_; //!< Number of times the beacon can be exectued. 78 78 QuestEffectBeaconStatus::Enum status_; 79 Trigger* trigger_;79 PlayerTrigger* trigger_; 80 80 81 81 bool setTimes(const int & n); 82 82 bool addEffect(QuestEffect* effect); 83 bool addTrigger( Trigger* trigger);83 bool addTrigger(PlayerTrigger* trigger); 84 84 85 85 const QuestEffect* getEffect(unsigned int index) const; -
code/branches/questsystem2/src/orxonox/objects/worldentities/triggers/DistanceTrigger.cc
r2103 r2193 39 39 CreateFactory(DistanceTrigger); 40 40 41 DistanceTrigger::DistanceTrigger(BaseObject* creator) : Trigger(creator)41 DistanceTrigger::DistanceTrigger(BaseObject* creator) : PlayerTrigger(creator) 42 42 { 43 43 RegisterObject(DistanceTrigger); … … 45 45 this->distance_ = 100; 46 46 this->targetMask_.exclude(Class(BaseObject)); 47 this->player_ = NULL; 47 48 } 48 49 … … 117 118 Vector3 distanceVec = entity->getWorldPosition() - this->getWorldPosition(); 118 119 if (distanceVec.length() < this->distance_) 120 { 121 this->player_ = dynamic_cast<ControllableEntity*>(entity); 119 122 return true; 123 } 120 124 } 121 125 return false; 122 126 127 } 128 129 ControllableEntity* DistanceTrigger::getTriggeringPlayer(void) const 130 { 131 return this->player_; 123 132 } 124 133 -
code/branches/questsystem2/src/orxonox/objects/worldentities/triggers/DistanceTrigger.h
r2103 r2193 30 30 #define _DistanceTrigger_H__ 31 31 32 #include " Trigger.h"32 #include "PlayerTrigger.h" 33 33 34 34 #include <set> … … 37 37 #include "core/BaseObject.h" 38 38 39 #include "orxonox/objects/worldentities/ControllableEntity.h" 40 39 41 namespace orxonox 40 42 { 41 class _OrxonoxExport DistanceTrigger : public Trigger43 class _OrxonoxExport DistanceTrigger : public PlayerTrigger 42 44 { 43 45 public: … … 56 58 inline float getDistance() const 57 59 { return this->distance_; } 60 61 virtual ControllableEntity* getTriggeringPlayer(void) const; 58 62 59 63 bool checkDistance(); … … 66 70 std::set<Ogre::Node*> targetSet_; 67 71 float distance_; 72 73 ControllableEntity* player_; 74 68 75 }; 69 76 }
Note: See TracChangeset
for help on using the changeset viewer.