Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 14, 2011, 4:33:33 PM (13 years ago)
Author:
anbueche
Message:

portals work pretty good

File:
1 edited

Legend:

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

    r8200 r8243  
    1111#include "graphics/Billboard.h"
    1212#include "objects/triggers/DistanceMultiTrigger.h"
     13#include "core/EventIncludes.h"
    1314
    1415namespace orxonox
    1516{
    16     class _PortalsExport PortalEndPoint : public DistanceMultiTrigger
     17    class _PortalsExport PortalEndPoint : public StaticEntity
    1718    {
    1819        public:
     
    2021            virtual ~PortalEndPoint();
    2122            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    22             //virtual void tick(float dt);
     23            inline void setTargets(const std::string & targets)
     24            {
     25                this->trigger_->addTargets(targets);
     26            }
     27           
     28            void XMLEventPort(Element& xmlelement, XMLPort::Mode mode);
    2329            static std::map<unsigned int, PortalEndPoint *> idMap_s; //!< maps integer id values to portalendpoints
    2430            inline void setID(unsigned int id)
     
    3137                return this->id_;
    3238            }
    33             void jumpOut(WorldEntity * entity); //!< relocate an entity to the position of the endpoint and add it to the set of recentlyPortedOut entities
    34             void tick(float dt);
    35             bool hasRecentlyJumpedOut(WorldEntity * entity); //!< check if a certain entity recently jumped out of this endpoint
     39            inline void setTemplate(const std::string & name)
     40            {
     41                this->templateName_ = name;
     42                this->addTemplate(name);
     43            }
     44            inline const std::string & getTemplate()
     45            {
     46                return this->templateName_;
     47            }
     48            bool execute(bool bTriggered, BaseObject* trigger);
     49            void jumpOut(MobileEntity * entity);
    3650        protected:
    3751        private:
    3852            unsigned int id_;
    39             std::set<WorldEntity *> 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
     53            DistanceMultiTrigger * trigger_;
     54            std::string templateName_;
     55            void setEventTemplate(const std::string & temp)
     56            {
     57                this->addTemplate(temp);
     58            }
     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
    4060    };
    4161
Note: See TracChangeset for help on using the changeset viewer.