- Timestamp:
- May 26, 2011, 4:35:46 PM (13 years ago)
- Location:
- code/branches/presentation
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation
- Property svn:mergeinfo changed
/code/branches/portals2 (added) merged: 8460,8466,8483,8511,8599-8600
- Property svn:mergeinfo changed
-
code/branches/presentation/src/modules/portals/PortalEndPoint.h
r8457 r8605 1 /* 2 * ORXONOX - the hottest 3D action shooter ever to exist 3 * > www.orxonox.net < 4 * 5 * 6 * License notice: 7 * 8 * This program is free software; you can redistribute it and/or 9 * modify it under the terms of the GNU General Public License 10 * as published by the Free Software Foundation; either version 2 11 * of the License, or (at your option) any later version. 12 * 13 * This program is distributed in the hope that it will be useful, 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 * GNU General Public License for more details. 17 * 18 * You should have received a copy of the GNU General Public License 19 * along with this program; if not, write to the Free Software 20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 21 * 22 * Author: 23 * Andreas Büchel 24 * Co-authors: 25 * ... 26 * 27 */ 28 29 /** 30 * @file PortalEndPoint.h 31 * @brief Declaration of the PortalEndPoint class. 32 * @ingroup Portals 33 */ 34 1 35 #ifndef _PortalEndPoint_H__ 2 36 #define _PortalEndPoint_H__ … … 12 46 #include "objects/triggers/DistanceMultiTrigger.h" 13 47 #include "core/EventIncludes.h" 48 #include <ctime> 14 49 15 50 namespace orxonox 16 51 { 52 /** 53 @brief 54 A PortalEndPoint serves as portal entrance and/or exit. 55 56 @ingroup Portals 57 */ 58 17 59 class _PortalsExport PortalEndPoint : public StaticEntity 18 60 { … … 28 70 void XMLEventPort(Element& xmlelement, XMLPort::Mode mode); 29 71 static std::map<unsigned int, PortalEndPoint *> idMap_s; //!< Maps the id of each PortalEndPoint to a pointer to that PortalEndPoint 72 inline void setReenterDelay(unsigned int seconds) 73 { 74 this->reenterDelay_ = seconds; 75 } 76 inline unsigned int getReenterDelay() 77 { 78 return this->reenterDelay_; 79 } 30 80 inline void setID(unsigned int id) 31 81 { … … 52 102 53 103 /*! \brief This function is called each time the DistanceMultiTrigger of this PortalEndPoint changed 54 * \param bTriggered true if the trigger was triggered on, false if the trigger has switched to off 55 * \param trigger the MultiTriggerContainer containing the triggering BaseObject (and trigger_ the portal's MultiDistanceTrigger which we already know) 56 * 57 * if bTriggered is \c true the triggering entity enters this portal (if it is an entrance) 58 * otherwise the triggering entity is removed from the set of entities who recently jumped out of this portal */ 104 \param bTriggered true if the trigger was triggered on, false if the trigger has switched to off 105 \param trigger the MultiTriggerContainer containing the triggering BaseObject (and trigger_ the portal's MultiDistanceTrigger which we already know) 106 */ 59 107 bool execute(bool bTriggered, BaseObject* trigger); 60 108 … … 62 110 * \param entity The Entity which should jump out of this portal */ 63 111 void jumpOut(MobileEntity * entity); 112 113 /** \brief Tells wether a certain Entity is allowed to enter the PortalEndPoint? 114 @return @c true if the entity not just came out of this portal and the reenterDelay has expired for it, @c false otherwise 115 */ 116 bool letsEnter(MobileEntity* entity); 64 117 protected: 65 118 … … 71 124 std::string templateName_; //!< The name of the design template used for this endpoint 72 125 73 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 126 int reenterDelay_; 127 std::map<MobileEntity *, time_t> jumpOutTimes_; //!< Stores the time at which a certain MobileEntity @ref jumpOut "jumped out" of this PortalEndPoint 128 std::set<MobileEntity *> recentlyJumpedOut_; //!< Stores the entities witch recently jumped out of this PortalEndPoint and haven't left the activation radius yet. This is needed in order to prevent them from beeing pulled into the PortalEndPoint they have just come out of. 74 129 }; 75 130
Note: See TracChangeset
for help on using the changeset viewer.