Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

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

last commit

File size: 1.9 KB
RevLine 
[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"
[12393]9#include "worldentities/pawns/Pawn.h"
[12251]10#include "tools/Timer.h"
11
12namespace orxonox
13{
14
15    /**
16    @brief
17
18    @author
19
20    @ingroup OrxoBlox
21    */
[12393]22    class _OrxoBloxExport OrxoBloxStones : public Pawn
[12251]23    {
24        public:
25            OrxoBloxStones(Context* context); //!< Constructor. Registers and initializes the object.
26            virtual ~OrxoBloxStones() {}
27             //   this.destroy();
28            //}
29
30            /**
[12331]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_; }
[12402]42           
[12251]43            void gotHit(){
[12402]44                orxout()<<"GOT HIT"<<endl;
45                unsigned int health_ =this->getHealth();
46                if (health_> 0){
47                    this->setHealth(++health_); 
[12251]48                    }
[12402]49                else {
50                    this->kill();
[12251]51                }
[12402]52                }
[12251]53
[12307]54            void setGame(OrxoBlox* orxoblox)
55                { assert(orxoblox); orxoblox_ = orxoblox; }
[12356]56
57            unsigned int getHealth();
58
59            void reduceHealth();
[12360]60
61            float getSize();
[12394]62            virtual bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* ownCollisionShape, btManifoldPoint& contactPoint) override;
[12307]63               
[12251]64        private:
65            float size_; //!< The dimensions a stone has in the game world.
66            bool delay_;
67           
[12307]68            OrxoBlox* orxoblox_;
[12251]69           
70
71    };
72}
73
74#endif /* _OrxoBloxStones_H__ */
Note: See TracBrowser for help on using the repository browser.