aboutsummaryrefslogtreecommitdiff
path: root/Simulation/Entity.hpp
blob: 03746116a2aa11f2e11e3d98e0bf25a122ce4f0e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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__