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