123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- #ifndef TINYSHOOTER_ENTITY_H
- #define TINYSHOOTER_ENTITY_H
- #include <box2d/box2d.h>
- #include <vector>
- #include "../Graphics/Visual.h"
- enum Faction {WALL, BULLET, ALLY, FOE};
- class Entity {
-
- public :
- Entity(Faction faction, unsigned int imgId, b2World* physics);
- virtual ~Entity();
- virtual void update() = 0;
- virtual Visual* makeVisual();
- bool isExist() const;
- bool isTouching() const;
- b2Vec2 getPos() const;
- Faction getFaction() const;
- void setExistence(bool exist);
- protected:
- void establishPhysicalLink();
-
- protected:
- Faction m_faction;
- bool m_exist;
- b2World* m_physics;
- b2Body* m_body;
- unsigned int m_imgId;
- };
- #endif
|