Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxStones.h @ 12402

Last change on this file since 12402 was 12402, checked in by ahuwyler, 5 years ago

last commit

File size: 1.9 KB
Line 
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
12namespace 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            void gotHit(){
44                orxout()<<"GOT HIT"<<endl;
45                unsigned int health_ =this->getHealth();
46                if (health_> 0){
47                    this->setHealth(++health_); 
48                    }
49                else {
50                    this->kill();
51                }
52                }
53
54            void setGame(OrxoBlox* orxoblox)
55                { assert(orxoblox); orxoblox_ = orxoblox; }
56
57            unsigned int getHealth();
58
59            void reduceHealth();
60
61            float getSize();
62            virtual bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* ownCollisionShape, btManifoldPoint& contactPoint) override;
63               
64        private:
65            float size_; //!< The dimensions a stone has in the game world.
66            bool delay_;
67           
68            OrxoBlox* orxoblox_;
69           
70
71    };
72}
73
74#endif /* _OrxoBloxStones_H__ */
Note: See TracBrowser for help on using the repository browser.