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