[12251] | 1 | #ifndef _OrxoBloxStones_H__ |
---|
| 2 | #define _OrxoBloxStones_H__ |
---|
| 3 | |
---|
| 4 | |
---|
[12331] | 5 | #include "OrxoBlox/OrxoBloxPrereqs.h" |
---|
| 6 | |
---|
| 7 | |
---|
[12251] | 8 | #include "worldentities/StaticEntity.h" |
---|
| 9 | #include "tools/Timer.h" |
---|
| 10 | |
---|
| 11 | namespace orxonox |
---|
| 12 | { |
---|
| 13 | |
---|
| 14 | /** |
---|
| 15 | @brief |
---|
| 16 | |
---|
| 17 | @author |
---|
| 18 | |
---|
| 19 | @ingroup OrxoBlox |
---|
| 20 | */ |
---|
| 21 | class _OrxoBloxExport OrxoBloxStones : public StaticEntity |
---|
| 22 | { |
---|
| 23 | public: |
---|
| 24 | OrxoBloxStones(Context* context); //!< Constructor. Registers and initializes the object. |
---|
| 25 | virtual ~OrxoBloxStones() {} |
---|
| 26 | // this.destroy(); |
---|
| 27 | //} |
---|
| 28 | |
---|
| 29 | /** |
---|
[12331] | 30 | @brief Set the size of the stone. |
---|
| 31 | @param size The dimensions a stone has in the game world. (A stone is a cube) |
---|
| 32 | */ |
---|
| 33 | void setSize(float size) |
---|
| 34 | { this->size_ = size; } |
---|
| 35 | /** |
---|
| 36 | @brief Get the size of the stone. |
---|
| 37 | @return Returns the dimensions a stone has in the game world. (A stone is a cube) |
---|
| 38 | */ |
---|
| 39 | float getSize(void) const |
---|
| 40 | { return this->size_; } |
---|
| 41 | /** |
---|
[12251] | 42 | @brief Set the Health of the stone. |
---|
| 43 | @param size The dimensions a stone has in the game world. (A stone is a cube) |
---|
| 44 | */ |
---|
| 45 | void setHealth(unsigned int health) |
---|
| 46 | { |
---|
| 47 | this->health_ = health; |
---|
| 48 | } |
---|
| 49 | /** |
---|
| 50 | @brief Get the size of the stone. |
---|
| 51 | @return Returns the dimensions a stone has in the game world. (A stone is a cube) |
---|
| 52 | */ |
---|
| 53 | unsigned int getHealth(void) const |
---|
| 54 | { return this->health_; } |
---|
| 55 | |
---|
| 56 | void gotHit(){ |
---|
| 57 | if (this->health_ > 0){ |
---|
| 58 | this->health_ -= this->health_; |
---|
| 59 | } |
---|
| 60 | // else ~OrxoBloxStones(); |
---|
| 61 | } |
---|
| 62 | |
---|
[12307] | 63 | void setGame(OrxoBlox* orxoblox) |
---|
| 64 | { assert(orxoblox); orxoblox_ = orxoblox; } |
---|
[12356] | 65 | |
---|
| 66 | unsigned int getHealth(); |
---|
| 67 | |
---|
| 68 | void reduceHealth(); |
---|
[12360] | 69 | |
---|
| 70 | float getSize(); |
---|
[12307] | 71 | |
---|
[12251] | 72 | private: |
---|
| 73 | float size_; //!< The dimensions a stone has in the game world. |
---|
| 74 | unsigned int health_; |
---|
| 75 | bool delay_; |
---|
| 76 | |
---|
[12307] | 77 | OrxoBlox* orxoblox_; |
---|
[12251] | 78 | |
---|
| 79 | |
---|
| 80 | }; |
---|
| 81 | } |
---|
| 82 | |
---|
| 83 | #endif /* _OrxoBloxStones_H__ */ |
---|