aboutsummaryrefslogtreecommitdiff
path: root/Simulation/Entity.hpp
diff options
context:
space:
mode:
authorPaul Oliver <contact@pauloliver.dev>2024-02-29 19:27:35 +0100
committerPaul Oliver <contact@pauloliver.dev>2024-02-29 19:27:49 +0100
commit17909d029c6a8872b2fddf4e171d7925bbbe9c5c (patch)
treecbb08af84cd68d24acc362d593a2048b0fa79689 /Simulation/Entity.hpp
Initial commitHEADmaster
Diffstat (limited to 'Simulation/Entity.hpp')
-rw-r--r--Simulation/Entity.hpp34
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__