Changeset 2936
- Timestamp:
- Apr 27, 2009, 5:15:04 PM (16 years ago)
- Location:
- code/branches/gametypes/src/orxonox/objects
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/gametypes/src/orxonox/objects/gametypes/Asteroids.cc
r2905 r2936 54 54 } 55 55 56 void Deathmatch::end()56 void Asteroids::end() 57 57 { 58 58 Gametype::end(); -
code/branches/gametypes/src/orxonox/objects/gametypes/CMakeLists.txt
r2934 r2936 6 6 Pong.cc 7 7 UnderAttack.cc 8 Asteroids.cc 8 9 ) -
code/branches/gametypes/src/orxonox/objects/worldentities/triggers/CMakeLists.txt
r2710 r2936 4 4 EventTrigger.cc 5 5 PlayerTrigger.cc 6 CheckPoint.cc 6 7 ) -
code/branches/gametypes/src/orxonox/objects/worldentities/triggers/CheckPoint.cc
r2905 r2936 29 29 #include "OrxonoxStableHeaders.h" 30 30 #include "CheckPoint.h" 31 #include "objects/gametypes/Asteroids.h" 31 32 32 33 #include <OgreNode.h> … … 45 46 RegisterObject(CheckPoint); 46 47 47 isForPlayer_ = true; 48 bStayActive_ = true; 48 this->setStayActive(true); 49 this->setDistance(20); 50 bIsDestination_ = false; 51 this->setVisible(true); 49 52 } 50 53 … … 52 55 { 53 56 } 57 58 void CheckPoint::XMLPort(Element& xmlelement, XMLPort::Mode mode) 59 { 60 SUPER(CheckPoint, XMLPort, xmlelement, mode); 54 61 55 void Checkpoint::triggered(bool bIsTriggered) 62 XMLPortParam(CheckPoint, "isdestination", setDestination, getDestination, xmlelement, mode).defaultValues(false); 63 } 64 65 void CheckPoint::setDestination(bool isDestination) 66 { 67 bIsDestination_ = isDestination; 68 } 69 70 bool CheckPoint::getDestination() 71 { 72 return bIsDestination_; 73 } 74 75 76 void CheckPoint::triggered(bool bIsTriggered) 56 77 { 57 78 DistanceTrigger::triggered(bIsTriggered); 58 79 59 if (bIsTriggered )80 if (bIsTriggered && bIsDestination_) 60 81 { 61 //... 82 Asteroids* gametype = dynamic_cast<Asteroids*>(this->getGametype()); 83 if (gametype) 84 { 85 gametype->end(); 86 } 62 87 } 63 88 } -
code/branches/gametypes/src/orxonox/objects/worldentities/triggers/CheckPoint.h
r2905 r2936 36 36 #define _CheckPoint_H__ 37 37 38 #include " OrxonoxPrereqs.h"38 #include "DistanceTrigger.h" 39 39 40 #include "Trigger.h" 40 #include <set> 41 42 #include "core/ClassTreeMask.h" 43 #include "core/BaseObject.h" 44 45 #include "orxonox/objects/worldentities/ControllableEntity.h" 41 46 42 47 namespace orxonox 43 48 { 44 49 class _OrxonoxExport CheckPoint : public DistanceTrigger 45 50 { 46 51 public: 47 48 52 CheckPoint(BaseObject* creator); 53 virtual ~CheckPoint(); 49 54 50 55 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a CheckPoint object through XML. 51 56 52 53 57 private: 54 virtual void triggered(bool bIsTriggered); 55 56 bool bIsDestination_; 57 }; 58 58 virtual void triggered(bool bIsTriggered); 59 virtual void setDestination(bool isDestination); 60 virtual bool getDestination(); 61 62 bool bIsDestination_; 63 }; 59 64 } 60 65 -
code/branches/gametypes/src/orxonox/objects/worldentities/triggers/Trigger.h
r2905 r2936 89 89 { return this->remainingActivations_; } 90 90 91 inline void setVisible(bool visibility) 92 { this->debugBillboard_.setVisible(visibility); } 93 91 94 void setDelay(float delay); 92 95 inline float getDelay() const
Note: See TracChangeset
for help on using the changeset viewer.