Changeset 8290
- Timestamp:
- Apr 21, 2011, 10:48:55 PM (14 years ago)
- Location:
- code/branches/portals
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/portals/data/levels/portals.oxw
r8278 r8290 26 26 > 27 27 28 <Template name=portalEventTemplate>29 <PortalEndPoint>30 <events>31 <execute>32 <EventListener event="portal" />33 </execute>34 </events>35 </PortalEndPoint>36 </Template>37 38 28 <Template name=portalDefault> 39 29 <PortalEndPoint> … … 45 35 46 36 <PortalEndPoint position="0,0,0" id="1" distance="40" target="MobileEntity" design="portalDefault" eventTemplate="portalEventTemplate" /> 47 <PortalEndPoint position="-400,0,0" id="2" distance="40" lookat="0,100,0" target="MobileEntity" design="portalDefault" eventTemplate="portalEventTemplate"/>37 <PortalEndPoint position="-400,0,0" id="2" distance="40" lookat="0,100,0" target="MobileEntity" design="portalDefault" /> 48 38 <PortalLink fromID="1" toID="2" /> 49 39 <PortalLink fromID="2" toID="1" /> -
code/branches/portals/src/modules/portals/PortalEndPoint.cc
r8278 r8290 9 9 { 10 10 CreateFactory(PortalEndPoint); 11 12 /*static*/ const std::string PortalEndPoint::EVENTFUNCTIONNAME = "execute"; 11 13 12 14 std::map<unsigned int, PortalEndPoint *> PortalEndPoint::idMap_s; … … 31 33 XMLPortParam(PortalEndPoint, "design", setTemplate, getTemplate, xmlelement, mode); 32 34 XMLPortParamExtern(PortalEndPoint, DistanceMultiTrigger, this->trigger_, "distance", setDistance, getDistance, xmlelement, mode); 33 XMLPortParamLoadOnly(PortalEndPoint, "eventTemplate", setEventTemplate, xmlelement, mode);34 35 XMLPortParamLoadOnly(PortalEndPoint, "target", setTargets, xmlelement, mode).defaultValues("Pawn"); 36 37 // Add the DistanceMultiTrigger as event source. 38 this->addEventSource(this->trigger_, EVENTFUNCTIONNAME); 35 39 36 40 if(mode == XMLPort::LoadObject) … … 44 48 SUPER(PortalEndPoint, XMLEventPort, xmlelement, mode); 45 49 46 XMLPortEventSink(PortalEndPoint, BaseObject, "execute", execute, xmlelement, mode);50 XMLPortEventSink(PortalEndPoint, BaseObject, EVENTFUNCTIONNAME, execute, xmlelement, mode); 47 51 } 48 52 -
code/branches/portals/src/modules/portals/PortalEndPoint.h
r8243 r8290 49 49 void jumpOut(MobileEntity * entity); 50 50 protected: 51 51 52 private: 53 static const std::string EVENTFUNCTIONNAME; 54 52 55 unsigned int id_; 53 56 DistanceMultiTrigger * trigger_; 54 57 std::string templateName_; 55 void setEventTemplate(const std::string & temp) 56 { 57 this->addTemplate(temp); 58 } 58 59 59 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 60 60 };
Note: See TracChangeset
for help on using the changeset viewer.