Changeset 6800 for code/trunk/src/modules
- Timestamp:
- Apr 29, 2010, 1:16:16 PM (15 years ago)
- Location:
- code/trunk/src/modules
- Files:
-
- 6 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/modules/objects/ObjectsPrereqs.h
r5929 r6800 85 85 // triggers 86 86 class CheckPoint; 87 class DistanceMultiTrigger; 87 88 class DistanceTrigger; 88 89 class EventTrigger; 90 class MultiTrigger; 91 class MultiTriggerContainer; 89 92 class Trigger; 90 93 } -
code/trunk/src/modules/objects/eventsystem/EventListener.cc
r6417 r6800 61 61 return; 62 62 } 63 64 COUT(4) << "EventListener: Processing event: originator: " << event.originator_->getIdentifier()->getName() << " (&" << event.originator_ << ")" << ", activate: " << event.activate_ << ", name: " << event.name_ << std::endl; 63 65 64 66 this->bActive_ = true; -
code/trunk/src/modules/objects/triggers/CMakeLists.txt
r5781 r6800 1 1 ADD_SOURCE_FILES(OBJECTS_SRC_FILES 2 Trigger.cc 2 CheckPoint.cc 3 DistanceMultiTrigger.cc 3 4 DistanceTrigger.cc 4 5 EventTrigger.cc 5 CheckPoint.cc 6 MultiTrigger.cc 7 MultiTriggerContainer.cc 8 Trigger.cc 6 9 ) -
code/trunk/src/modules/questsystem/CMakeLists.txt
r5781 r6800 34 34 LINK_LIBRARIES 35 35 orxonox 36 objects 36 37 overlays 37 38 SOURCE_FILES ${QUESTSYSTEM_SRC_FILES} -
code/trunk/src/modules/questsystem/QuestEffectBeacon.cc
r5938 r6800 39 39 #include "worldentities/pawns/Pawn.h" 40 40 #include "interfaces/PlayerTrigger.h" 41 #include "objects/triggers/MultiTriggerContainer.h" 41 42 #include "QuestEffect.h" 42 43 … … 75 76 XMLPortObject(QuestEffectBeacon, QuestEffect, "effects", addEffect, getEffect, xmlelement, mode); 76 77 77 XMLPortEventState(QuestEffectBeacon, PlayerTrigger, "execute", execute, xmlelement, mode);78 XMLPortEventState(QuestEffectBeacon, BaseObject, "execute", execute, xmlelement, mode); //TODO: Change BaseObject to MultiTrigger as soon as MultiTrigger is the base of all triggers. 78 79 79 80 COUT(3) << "New QuestEffectBeacon created." << std::endl; … … 84 85 SUPER(QuestEffectBeacon, XMLEventPort, xmlelement, mode); 85 86 86 XMLPortEventS tate(QuestEffectBeacon, PlayerTrigger, "execute", execute, xmlelement, mode);87 XMLPortEventSink(QuestEffectBeacon, BaseObject, "execute", execute, xmlelement, mode); 87 88 } 88 89 … … 92 93 This means extracting the Pawn from the PlayerTrigger, provided by the Event causing the execution, and the extracting the PlayerInfo from the received Pawn and invoking the QuestEffectbeacon's QuestEffects on the received PlayerInfo. 93 94 @param trigger 94 A pointer to the PlayerTrigger that threw the Event.95 A pointer to the PlayerTrigger that threw the Event. 95 96 @return 96 97 Returns true if successfully executed, false if not. 97 98 */ 98 bool QuestEffectBeacon::execute(bool b, PlayerTrigger* trigger) 99 { 99 bool QuestEffectBeacon::execute(bool b, BaseObject* trigger) 100 { 101 //TODO: Remove debug output. 102 COUT(1) << "Debug: Calling execute on QuestEffectBeacon." << std::endl; 103 100 104 if(!b) 101 105 { … … 108 112 } 109 113 110 if(!trigger->isForPlayer()) //!< The PlayerTrigger is not exclusively for Pawns which means we cannot extract one. 111 { 112 return false; 113 } 114 115 //! Extracting the Pawn from the PlayerTrigger. 116 Pawn* pawn = trigger->getTriggeringPlayer(); 114 PlayerTrigger* pTrigger = orxonox_cast<PlayerTrigger*>(trigger); 115 MultiTriggerContainer* mTrigger = orxonox_cast<MultiTriggerContainer*>(trigger); 116 Pawn* pawn = NULL; 117 118 //! If the trigger is neither a Playertrigger nor a MultiTrigger (i.e. a MultitriggerContainer) we can do anything with it. 119 if(pTrigger == NULL && mTrigger == NULL) 120 return false; 121 122 // If the trigger is a PlayerTrigger. 123 if(pTrigger != NULL) 124 { 125 if(!pTrigger->isForPlayer()) //!< The PlayerTrigger is not exclusively for Pawns which means we cannot extract one. 126 return false; 127 else 128 pawn = pTrigger->getTriggeringPlayer(); 129 } 130 131 // If the trigger is a MultiTrigger (i.e. a MultiTriggerContainer) 132 if(mTrigger != NULL) 133 { 134 pawn = orxonox_cast<Pawn*>(mTrigger->getData()); 135 } 117 136 118 137 if(pawn == NULL) -
code/trunk/src/modules/questsystem/QuestEffectBeacon.h
r5938 r6800 88 88 virtual void XMLEventPort(Element& xmlelement, XMLPort::Mode mode); 89 89 90 bool execute(bool b, PlayerTrigger* trigger); //!< Executes the QuestEffects of the QuestEffectBeacon.90 bool execute(bool b, BaseObject* trigger); //!< Executes the QuestEffects of the QuestEffectBeacon. 91 91 92 92 /**
Note: See TracChangeset
for help on using the changeset viewer.