X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=examples%2Fbassteroids%2Fsource%2Fphysics.h;h=1e7bec3e95cb3e2b0f8d6923a5b1816597d28cd0;hb=338031de484ee117762d80449d9ca472a6918c92;hp=096e228095fdc94b131ca4796d505bc8e6cb63ad;hpb=9ce882cbb6bb7628d7c9883c43491a75c10625d7;p=libs%2Fgame.git diff --git a/examples/bassteroids/source/physics.h b/examples/bassteroids/source/physics.h index 096e228..1e7bec3 100644 --- a/examples/bassteroids/source/physics.h +++ b/examples/bassteroids/source/physics.h @@ -2,16 +2,21 @@ #define PHYSICS_H_ #include +#include #include #include #include #include #include +#include "events.h" class PhysicalEntity; class Physics: public Msp::Game::System { +public: + using EventSource = Msp::Game::EventSource; + private: struct SimulatedEntity { @@ -39,6 +44,7 @@ private: Msp::LinAl::Vector normal; }; + EventSource event_source; Msp::Game::EventObserver observer; std::vector entities; unsigned fixture_count = 0; @@ -49,6 +55,7 @@ public: private: void entity_added(const Msp::Game::Events::EntityCreated &); + void entity_removed(const Msp::Game::Events::EntityDestroyed &); public: void tick(Msp::Time::TimeDelta) override;