Last change
on this file since 8474 was
8466,
checked in by anbueche, 14 years ago
|
comments added
|
-
Property svn:executable set to
*
|
File size:
1.8 KB
|
Line | |
---|
1 | /** |
---|
2 | @file PortalLink.h |
---|
3 | @brief Declaration of the PortalLink class |
---|
4 | @ingroup Portals |
---|
5 | */ |
---|
6 | |
---|
7 | #ifndef _PortalLink_H__ |
---|
8 | #define _PortalLink_H__ |
---|
9 | |
---|
10 | #include "portals/PortalsPrereqs.h" |
---|
11 | #include "tools/interfaces/Tickable.h" |
---|
12 | #include "core/BaseObject.h" |
---|
13 | #include "PortalEndPoint.h" |
---|
14 | #include "objects/eventsystem/EventListener.h" |
---|
15 | |
---|
16 | #include <map> |
---|
17 | |
---|
18 | namespace orxonox |
---|
19 | { |
---|
20 | /** |
---|
21 | @brief |
---|
22 | A PortalLink represents the connection between two @ref orxonox::PortalEndPoint "PortalEndPoints" |
---|
23 | @ingroup Portals |
---|
24 | */ |
---|
25 | class _PortalsExport PortalLink : public BaseObject |
---|
26 | { |
---|
27 | public: |
---|
28 | PortalLink(BaseObject* creator); |
---|
29 | virtual ~PortalLink(); |
---|
30 | virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); |
---|
31 | inline void setFromID(unsigned int from) //!< set the ID of the PortalEndPoint which should act as the entrance of this link |
---|
32 | { |
---|
33 | this->fromID_ = from; |
---|
34 | } |
---|
35 | inline unsigned int getFromID(unsigned int) const |
---|
36 | { |
---|
37 | return this->fromID_; |
---|
38 | } |
---|
39 | inline void setToID(unsigned int to) //!< set the ID of the PortalEndPoint which should act as the exit of this link |
---|
40 | { |
---|
41 | this->toID_ = to; |
---|
42 | } |
---|
43 | inline unsigned int getToID(unsigned int) const |
---|
44 | { |
---|
45 | return this->toID_; |
---|
46 | } |
---|
47 | static void use(MobileEntity * entity, PortalEndPoint * entrance); // |
---|
48 | protected: |
---|
49 | private: |
---|
50 | static std::map<PortalEndPoint *, PortalEndPoint *> links_s; |
---|
51 | unsigned int fromID_; |
---|
52 | unsigned int toID_; |
---|
53 | PortalEndPoint* from_; |
---|
54 | PortalEndPoint* to_; |
---|
55 | float activationRadius_; |
---|
56 | bool isNowPortable(WorldEntity * ent); |
---|
57 | }; |
---|
58 | |
---|
59 | } |
---|
60 | |
---|
61 | #endif /* _Portals_H__ */ |
---|
Note: See
TracBrowser
for help on using the repository browser.