Line | |
---|
1 | #ifndef _DOOR_H |
---|
2 | #define _DOOR_H |
---|
3 | |
---|
4 | #include "world_entity.h" |
---|
5 | |
---|
6 | #include "md2/md2Model.h" |
---|
7 | |
---|
8 | class TiXmlElement; |
---|
9 | |
---|
10 | |
---|
11 | //! animation names enumeration |
---|
12 | typedef enum DoorAnimType |
---|
13 | { |
---|
14 | DOOR_OPEN = 0, |
---|
15 | DOOR_CLOSE, |
---|
16 | |
---|
17 | DOOR_MAX_ANIMATIONS |
---|
18 | }; |
---|
19 | |
---|
20 | |
---|
21 | class Door : public WorldEntity |
---|
22 | { |
---|
23 | ObjectListDeclaration(Door); |
---|
24 | |
---|
25 | public: |
---|
26 | Door(const TiXmlElement* root = NULL); |
---|
27 | virtual ~Door (); |
---|
28 | |
---|
29 | virtual void loadParams(const TiXmlElement* root); |
---|
30 | |
---|
31 | void setActionRadius(float radius) { this->actionRadius = radius; } |
---|
32 | void setScale(float scale) { this->scale = scale; } |
---|
33 | |
---|
34 | void open(); |
---|
35 | void close(); |
---|
36 | |
---|
37 | void lock() { this->bLocked = true; } |
---|
38 | void unlock() { this->bLocked = false; } |
---|
39 | bool isLocked() const { return this->bLocked; } |
---|
40 | |
---|
41 | |
---|
42 | virtual void tick (float time); |
---|
43 | |
---|
44 | |
---|
45 | private: |
---|
46 | void init(); |
---|
47 | bool checkOpen(); |
---|
48 | void setAnimation(int animNum, int playbackMode = 0); |
---|
49 | |
---|
50 | |
---|
51 | private: |
---|
52 | bool bOpen; //!< true if the door is open |
---|
53 | bool bLocked; //!< true if this door is locked |
---|
54 | float actionRadius; //!< action radius |
---|
55 | float scale; //!< the scale of the model |
---|
56 | |
---|
57 | static sAnim animationList[2]; //!< list of the animations |
---|
58 | |
---|
59 | |
---|
60 | }; |
---|
61 | |
---|
62 | #endif /* _DOOR_H */ |
---|
Note: See
TracBrowser
for help on using the repository browser.