diff options
Diffstat (limited to 'Simulation/Entity.hpp')
-rw-r--r-- | Simulation/Entity.hpp | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/Simulation/Entity.hpp b/Simulation/Entity.hpp new file mode 100644 index 0000000..0374611 --- /dev/null +++ b/Simulation/Entity.hpp @@ -0,0 +1,34 @@ +#ifndef __ENTITY_HPP__ +#define __ENTITY_HPP__ + +#include <SFML/Graphics.hpp> +#include <Box2D.h> + +class SimBase; + +class Entity +{ +public: + virtual void startup(SimBase *sim) = 0; + + void create(); + void destroy(); + + virtual void update() = 0; + virtual void draw() = 0; + + float getRadius() const { return radius; } + +protected: + SimBase *hSim = nullptr; + + b2Body *body = nullptr; + float radius = 0.f; + float resistance = 0.f; + + friend class ContactListener; + friend class Guppie; + friend class Camera; +}; + +#endif // __ENTITY_HPP__ |