- Timestamp:
- May 19, 2011, 4:01:34 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/portals2/src/modules/portals/PortalEndPoint.h
r8466 r8511 18 18 #include "objects/triggers/DistanceMultiTrigger.h" 19 19 #include "core/EventIncludes.h" 20 #include <ctime> 20 21 21 22 namespace orxonox … … 41 42 void XMLEventPort(Element& xmlelement, XMLPort::Mode mode); 42 43 static std::map<unsigned int, PortalEndPoint *> idMap_s; //!< Maps the id of each PortalEndPoint to a pointer to that PortalEndPoint 44 inline void setReenterDelay(unsigned int seconds) 45 { 46 this->reenterDelay_ = seconds; 47 } 48 inline unsigned int getReenterDelay() 49 { 50 return this->reenterDelay_; 51 } 43 52 inline void setID(unsigned int id) 44 53 { … … 65 74 66 75 /*! \brief This function is called each time the DistanceMultiTrigger of this PortalEndPoint changed 67 * \param bTriggered true if the trigger was triggered on, false if the trigger has switched to off 68 * \param trigger the MultiTriggerContainer containing the triggering BaseObject (and trigger_ the portal's MultiDistanceTrigger which we already know) 69 * 70 * if bTriggered is \c true the triggering entity enters this portal (if it is an entrance) 71 * otherwise the triggering entity is removed from the set of entities who recently jumped out of this portal */ 76 \param bTriggered true if the trigger was triggered on, false if the trigger has switched to off 77 \param trigger the MultiTriggerContainer containing the triggering BaseObject (and trigger_ the portal's MultiDistanceTrigger which we already know) 78 */ 72 79 bool execute(bool bTriggered, BaseObject* trigger); 73 80 … … 75 82 * \param entity The Entity which should jump out of this portal */ 76 83 void jumpOut(MobileEntity * entity); 84 85 /** \brief Tells wether a certain Entity is allowed to enter the PortalEndPoint? 86 @return @c true if the entity not just came out of this portal and the reenterDelay has expired for it, @c false otherwise 87 */ 88 bool letsEnter(MobileEntity* entity); 77 89 protected: 78 90 … … 84 96 std::string templateName_; //!< The name of the design template used for this endpoint 85 97 86 std::set<MobileEntity *> recentlyJumpedOut_; //!< Entities which recently jumped out of this EndPoint, hence they shouldn't be pulled in again if the endpoint is the beginning of a link 98 int reenterDelay_; 99 std::map<MobileEntity *, time_t> jumpOutTimes_; //!< Stores the time at which a certain MobileEntity @ref jumpOut "jumped out" of this PortalEndPoint 100 std::set<MobileEntity *> recentlyJumpedOut_; 87 101 }; 88 102
Note: See TracChangeset
for help on using the changeset viewer.