[4844] | 1 | /*! |
---|
| 2 | * @file mover_station.h |
---|
| 3 | * A station for a mover. |
---|
| 4 | */ |
---|
| 5 | |
---|
| 6 | #ifndef _MOVER_STATION_H |
---|
| 7 | #define _MOVER_STATION_H |
---|
| 8 | |
---|
| 9 | #include "world_entity.h" |
---|
| 10 | #include "sound_buffer.h" |
---|
| 11 | #include "sound/resource_sound_buffer.h" |
---|
| 12 | |
---|
| 13 | |
---|
| 14 | class MoverStation : public WorldEntity |
---|
| 15 | { |
---|
| 16 | friend class MoverStationList; |
---|
| 17 | |
---|
| 18 | ObjectListDeclaration(MoverStation); |
---|
| 19 | |
---|
| 20 | public: |
---|
| 21 | MoverStation(const TiXmlElement* root = NULL); |
---|
| 22 | virtual ~MoverStation(); |
---|
| 23 | |
---|
| 24 | virtual void loadParams(const TiXmlElement* root); |
---|
| 25 | |
---|
| 26 | void setRank(int id) { this->rank = id; } |
---|
[4855] | 27 | void setRelTargetCoor(float x = 0, float y = 0, float z = 0) { this->relTargetCoor = Vector(x, y, z); } |
---|
| 28 | void setRelTargetDir(float wx = 0, float wy = 0, float wz = 0) { this->relTargetDir = Vector(wx, wy, wz); } |
---|
[4844] | 29 | void setDelay(float t) { this->delay = t; } |
---|
| 30 | void setMovingTime(float t) { this->movingTime = t; } |
---|
| 31 | void setStayOpenTime(float t) { this->stayOpenTime = t; } |
---|
| 32 | void setAccelerate() { this->bAccelerate = true; } |
---|
| 33 | void setDecelerate() { this->bDecelerate = true; } |
---|
| 34 | void setJumpToRank(int rank) { this->jumpToRank = rank; this->bJumpToRank = true; } |
---|
| 35 | void setMoveToRank(int rank) { this->moveToRank = rank; this->bMoveToRank = true; } |
---|
| 36 | void setOpen() { this->bIsOpen = true; } |
---|
| 37 | void setClosed() { this->bIsClosed = true; } |
---|
| 38 | void setOpeningSoundFile(const std::string& fileName) { this->soundBuffer_opening = OrxSound::ResourceSoundBuffer(fileName); } |
---|
| 39 | void setOpenedSoundFile(const std::string& fileName) { this->soundBuffer_opened = OrxSound::ResourceSoundBuffer(fileName); } |
---|
| 40 | void setMovingSoundFile(const std::string& fileName) { this->soundBuffer_moving = OrxSound::ResourceSoundBuffer(fileName); } |
---|
| 41 | void setClosingSoundFile(const std::string& fileName) { this->soundBuffer_closing = OrxSound::ResourceSoundBuffer(fileName); } |
---|
| 42 | void setClosedSoundFile(const std::string& fileName) { this->soundBuffer_closed = OrxSound::ResourceSoundBuffer(fileName); } |
---|
| 43 | |
---|
| 44 | private: |
---|
| 45 | int rank; |
---|
| 46 | Vector relTargetCoor; |
---|
[4855] | 47 | Vector relTargetDir; |
---|
[4844] | 48 | float delay; |
---|
| 49 | float movingTime; |
---|
| 50 | float stayOpenTime; |
---|
| 51 | bool bAccelerate; |
---|
| 52 | bool bDecelerate; |
---|
| 53 | int jumpToRank; |
---|
| 54 | bool bJumpToRank; |
---|
| 55 | int moveToRank; |
---|
| 56 | bool bMoveToRank; |
---|
| 57 | bool bIsOpen; |
---|
| 58 | bool bIsClosed; |
---|
| 59 | OrxSound::SoundBuffer soundBuffer_opening; |
---|
| 60 | OrxSound::SoundBuffer soundBuffer_opened; |
---|
| 61 | OrxSound::SoundBuffer soundBuffer_moving; |
---|
| 62 | OrxSound::SoundBuffer soundBuffer_closing; |
---|
| 63 | OrxSound::SoundBuffer soundBuffer_closed; |
---|
| 64 | }; |
---|
| 65 | |
---|
| 66 | |
---|
| 67 | #endif |
---|