Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/portals/src/modules/portals/PortalLink.h @ 8200

Last change on this file since 8200 was 8200, checked in by FelixSchulthess, 13 years ago

blah

  • Property svn:executable set to *
File size: 1.5 KB
Line 
1#ifndef _PortalLink_H__
2#define _PortalLink_H__
3
4#include "portals/PortalsPrereqs.h"
5#include "tools/interfaces/Tickable.h"
6#include "core/BaseObject.h"
7#include "PortalEndPoint.h"
8#include "objects/eventsystem/EventListener.h"
9
10#include <set>
11
12namespace orxonox
13{
14    class _PortalsExport PortalLink : public EventListener
15    {
16        public:
17            PortalLink(BaseObject* creator);
18            virtual ~PortalLink();
19   
20            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
21            virtual void tick(float dt);
22            inline void setFromID(unsigned int from)
23            {
24                this->fromID_ = from;
25            }
26            inline unsigned int getFromID(unsigned int) const
27            {
28                return this->fromID_;
29            }
30            inline void setToID(unsigned int to)
31            {
32                this->toID_ = to;
33            }
34            inline unsigned int getToID(unsigned int) const
35            {
36                return this->toID_;
37            }
38            void use(WorldEntity * entity);
39            virtual void processEvent(Event& event);
40        protected:
41        private:
42            unsigned int fromID_;
43            unsigned int toID_;
44            PortalEndPoint* from_;
45            PortalEndPoint* to_;
46            float activationRadius_;
47            std::set<WorldEntity *> recentlyPorted;
48            ObjectList<WorldEntity>::iterator it_;
49            bool isNowPortable(WorldEntity * ent);
50    };
51
52}
53
54#endif /* _Portals_H__ */
Note: See TracBrowser for help on using the repository browser.