Changeset 8628 for code/branches/presentation/src
- Timestamp:
- May 27, 2011, 10:54:34 PM (14 years ago)
- Location:
- code/branches/presentation/src/modules/portals
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation/src/modules/portals/PortalEndPoint.cc
r8605 r8628 42 42 std::map<unsigned int, PortalEndPoint *> PortalEndPoint::idMap_s; 43 43 44 PortalEndPoint::PortalEndPoint(BaseObject* creator) : StaticEntity(creator), id_(0), trigger_(NULL), reenterDelay_(0)44 PortalEndPoint::PortalEndPoint(BaseObject* creator) : StaticEntity(creator), RadarViewable(creator, static_cast<WorldEntity*>(this)), id_(0), trigger_(NULL), reenterDelay_(0) 45 45 { 46 46 RegisterObject(PortalEndPoint); … … 49 49 this->trigger_->setName("portal"); 50 50 this->attach(trigger_); 51 52 this->setRadarObjectColour(ColourValue::White); 53 this->setRadarObjectShape(RadarViewable::Dot); 54 this->setRadarVisibility(true); 51 55 } 52 56 … … 117 121 } 118 122 123 void PortalEndPoint::changedActivity(void) 124 { 125 SUPER(PortalEndPoint, changedActivity); 126 127 this->setRadarVisibility(this->isActive()); 128 } 129 119 130 bool PortalEndPoint::letsEnter(MobileEntity* entity) 120 131 { -
code/branches/presentation/src/modules/portals/PortalEndPoint.h
r8605 r8628 43 43 44 44 #include "worldentities/StaticEntity.h" 45 #include "interfaces/RadarViewable.h" 45 46 #include "graphics/Billboard.h" 46 47 #include "objects/triggers/DistanceMultiTrigger.h" … … 57 58 */ 58 59 59 class _PortalsExport PortalEndPoint : public StaticEntity 60 class _PortalsExport PortalEndPoint : public StaticEntity, public RadarViewable 60 61 { 61 62 public: 62 63 PortalEndPoint(BaseObject* creator); 63 64 virtual ~PortalEndPoint(); 65 64 66 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); 67 virtual void changedActivity(void); 68 65 69 inline void setTarget(const std::string & target) //!< add types which are allowed to activate the PortalEndPoint 66 { 67 this->trigger_->addTarget(target); 68 } 70 { this->trigger_->addTarget(target); } 69 71 70 72 void XMLEventPort(Element& xmlelement, XMLPort::Mode mode); 71 73 static std::map<unsigned int, PortalEndPoint *> idMap_s; //!< Maps the id of each PortalEndPoint to a pointer to that PortalEndPoint 72 74 inline void setReenterDelay(unsigned int seconds) 73 { 74 this->reenterDelay_ = seconds; 75 } 75 { this->reenterDelay_ = seconds; } 76 76 inline unsigned int getReenterDelay() 77 { 78 return this->reenterDelay_; 79 } 77 { return this->reenterDelay_; } 80 78 inline void setID(unsigned int id) 81 { 82 this->id_ = id; 83 } 79 { this->id_ = id; } 84 80 85 81 inline unsigned int getID() const 86 { 87 return this->id_; 88 } 82 { return this->id_; } 89 83 90 84 /// \brief Set templateName_ (the name of the design Template) and add that Template to this Object 91 85 inline void setTemplate(const std::string & name) 92 { 93 this->templateName_ = name; 94 this->addTemplate(name); 95 } 86 { this->templateName_ = name; this->addTemplate(name); } 96 87 97 88 /// \brief Get the name of the attached design template 98 89 inline const std::string & getTemplate() 99 { 100 return this->templateName_; 101 } 90 { return this->templateName_; } 102 91 103 92 /*! \brief This function is called each time the DistanceMultiTrigger of this PortalEndPoint changed
Note: See TracChangeset
for help on using the changeset viewer.