| Rev | Line | |
|---|
| [9222] | 1 | #ifndef _GATE_H |
|---|
| 2 | #define _GATE_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 GateAnimType |
|---|
| 13 | { |
|---|
| 14 | GATE_OPEN = 0, |
|---|
| 15 | GATE_CLOSE, |
|---|
| 16 | GATE_DIE, |
|---|
| 17 | |
|---|
| 18 | GATE_MAX_ANIMATIONS |
|---|
| 19 | }; |
|---|
| 20 | |
|---|
| 21 | |
|---|
| 22 | class Gate : public WorldEntity |
|---|
| 23 | { |
|---|
| [9869] | 24 | ObjectListDeclaration(Gate); |
|---|
| 25 | |
|---|
| [9222] | 26 | public: |
|---|
| 27 | Gate(const TiXmlElement* root = NULL); |
|---|
| 28 | virtual ~Gate (); |
|---|
| 29 | |
|---|
| 30 | virtual void loadParams(const TiXmlElement* root); |
|---|
| 31 | |
|---|
| 32 | void setActionRadius(float radius) { this->actionRadius = radius; } |
|---|
| 33 | void setScale(float scale) { this->scale = scale; } |
|---|
| 34 | |
|---|
| 35 | void open(); |
|---|
| 36 | void close(); |
|---|
| 37 | void destroy(); |
|---|
| 38 | |
|---|
| 39 | void lock() { this->bLocked = true; } |
|---|
| 40 | void unlock() { this->bLocked = false; } |
|---|
| 41 | bool isLocked() const { return this->bLocked; } |
|---|
| 42 | |
|---|
| 43 | |
|---|
| 44 | virtual void tick (float time); |
|---|
| 45 | |
|---|
| 46 | |
|---|
| 47 | private: |
|---|
| 48 | void init(); |
|---|
| 49 | bool checkOpen(); |
|---|
| 50 | void setAnimation(int animNum, int playbackMode = 0); |
|---|
| 51 | |
|---|
| 52 | |
|---|
| 53 | private: |
|---|
| [9298] | 54 | bool destroyed; //!< true if the door is destroyed |
|---|
| [9222] | 55 | bool bOpen; //!< true if the door is open |
|---|
| 56 | bool bLocked; //!< true if this door is locked |
|---|
| 57 | float actionRadius; //!< action radius |
|---|
| 58 | float scale; //!< the scale of the model |
|---|
| 59 | |
|---|
| 60 | static sAnim animationList[3]; //!< list of the animations |
|---|
| 61 | |
|---|
| 62 | bool bDead; |
|---|
| 63 | |
|---|
| 64 | |
|---|
| 65 | }; |
|---|
| 66 | |
|---|
| 67 | #endif /* _GATE_H */ |
|---|
Note: See
TracBrowser
for help on using the repository browser.