Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 21, 2011, 10:48:55 PM (14 years ago)
Author:
dafrick
Message:

Moving the things done with the eventTemplate into the PortalEndPoint class.

Location:
code/branches/portals/src/modules/portals
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/portals/src/modules/portals/PortalEndPoint.cc

    r8278 r8290  
    99{
    1010    CreateFactory(PortalEndPoint);
     11   
     12    /*static*/ const std::string PortalEndPoint::EVENTFUNCTIONNAME = "execute";
    1113
    1214    std::map<unsigned int, PortalEndPoint *> PortalEndPoint::idMap_s;
     
    3133        XMLPortParam(PortalEndPoint, "design", setTemplate, getTemplate, xmlelement, mode);
    3234        XMLPortParamExtern(PortalEndPoint, DistanceMultiTrigger, this->trigger_, "distance", setDistance, getDistance, xmlelement, mode);
    33         XMLPortParamLoadOnly(PortalEndPoint, "eventTemplate", setEventTemplate, xmlelement, mode);
    3435        XMLPortParamLoadOnly(PortalEndPoint, "target", setTargets, xmlelement, mode).defaultValues("Pawn");
     36       
     37        // Add the DistanceMultiTrigger as event source.
     38        this->addEventSource(this->trigger_, EVENTFUNCTIONNAME);
    3539       
    3640        if(mode == XMLPort::LoadObject)
     
    4448        SUPER(PortalEndPoint, XMLEventPort, xmlelement, mode);
    4549       
    46         XMLPortEventSink(PortalEndPoint, BaseObject, "execute", execute, xmlelement, mode);
     50        XMLPortEventSink(PortalEndPoint, BaseObject, EVENTFUNCTIONNAME, execute, xmlelement, mode);
    4751    }
    4852
  • code/branches/portals/src/modules/portals/PortalEndPoint.h

    r8243 r8290  
    4949            void jumpOut(MobileEntity * entity);
    5050        protected:
     51           
    5152        private:
     53            static const std::string EVENTFUNCTIONNAME;
     54           
    5255            unsigned int id_;
    5356            DistanceMultiTrigger * trigger_;
    5457            std::string templateName_;
    55             void setEventTemplate(const std::string & temp)
    56             {
    57                 this->addTemplate(temp);
    58             }
     58
    5959            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
    6060    };
Note: See TracChangeset for help on using the changeset viewer.