From 17909d029c6a8872b2fddf4e171d7925bbbe9c5c Mon Sep 17 00:00:00 2001 From: Paul Oliver Date: Thu, 29 Feb 2024 19:27:35 +0100 Subject: Initial commit --- Simulation/Entity.hpp | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 Simulation/Entity.hpp (limited to 'Simulation/Entity.hpp') 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 +#include + +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__ -- cgit v1.2.1