Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/portals/src/modules/portals/PortalEndPoint.h @ 8290

Last change on this file since 8290 was 8290, checked in by dafrick, 13 years ago

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

  • Property svn:executable set to *
File size: 2.0 KB
RevLine 
[8177]1#ifndef _PortalEndPoint_H__
2#define _PortalEndPoint_H__
3
[8200]4#include "portals/PortalsPrereqs.h"
5
[8177]6#include <set>
7#include <string>
8#include <map>
9
[8200]10#include "worldentities/StaticEntity.h"
[8177]11#include "graphics/Billboard.h"
[8200]12#include "objects/triggers/DistanceMultiTrigger.h"
[8243]13#include "core/EventIncludes.h"
[8177]14
15namespace orxonox
16{
[8243]17    class _PortalsExport PortalEndPoint : public StaticEntity
[8177]18    {
19        public:
20            PortalEndPoint(BaseObject* creator);
21            virtual ~PortalEndPoint();
22            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
[8243]23            inline void setTargets(const std::string & targets)
24            {
25                this->trigger_->addTargets(targets);
26            }
27           
28            void XMLEventPort(Element& xmlelement, XMLPort::Mode mode);
[8198]29            static std::map<unsigned int, PortalEndPoint *> idMap_s; //!< maps integer id values to portalendpoints
[8177]30            inline void setID(unsigned int id)
31            {
32                this->id_ = id;
33            }
34           
35            inline unsigned int getID() const
36            {
37                return this->id_;
38            }
[8243]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);
[8177]50        protected:
[8290]51           
[8177]52        private:
[8290]53            static const std::string EVENTFUNCTIONNAME;
54           
[8177]55            unsigned int id_;
[8243]56            DistanceMultiTrigger * trigger_;
57            std::string templateName_;
[8290]58
[8243]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
[8177]60    };
61
62}
63
64#endif /* _Portals_H__ */
Note: See TracBrowser for help on using the repository browser.