- Timestamp:
- Apr 27, 2009, 5:15:04 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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 }
Note: See TracChangeset
for help on using the changeset viewer.