diff options
author | Alec Thomas <alec@swapoff.org> | 2014-10-27 11:17:20 +1100 |
---|---|---|
committer | Alec Thomas <alec@swapoff.org> | 2014-10-27 11:17:20 +1100 |
commit | f19eaf65bcd8dac1a852b1ee5084545a44585096 (patch) | |
tree | 19f5dae104c3ca5608f9df71b51929bc764ce59f | |
parent | 8158e9c732c75baf47e51c304ab593f9feb842c6 (diff) |
Fix example.
-rw-r--r-- | entityx/System_test.cc | 2 | ||||
-rw-r--r-- | examples/example.cc | 14 |
2 files changed, 8 insertions, 8 deletions
diff --git a/entityx/System_test.cc b/entityx/System_test.cc index 746a1ac..675abb8 100644 --- a/entityx/System_test.cc +++ b/entityx/System_test.cc @@ -36,7 +36,7 @@ class MovementSystem : public System<MovementSystem> { public: explicit MovementSystem(string label = "") : label(label) {} - void update(EntityManager &es, EventManager &events, double) override { + void update(EntityManager &es, EventManager &events, DeltaTime) override { EntityManager::View entities = es.entities_with_components<Position, Direction>(); ComponentHandle<Position> position; diff --git a/examples/example.cc b/examples/example.cc index 29ca68a..6cf75d4 100644 --- a/examples/example.cc +++ b/examples/example.cc @@ -86,7 +86,7 @@ struct CollisionEvent : public ex::Event<CollisionEvent> { // Updates a body's position and rotation. struct BodySystem : public ex::System<BodySystem> { - void update(ex::EntityManager &es, ex::EventManager &events, DeltaTime dt) override { + void update(ex::EntityManager &es, ex::EventManager &events, ex::DeltaTime dt) override { Body::Handle body; for (ex::Entity entity : es.entities_with_components(body)) { body->position += body->direction * static_cast<float>(dt); @@ -99,7 +99,7 @@ struct BodySystem : public ex::System<BodySystem> { // Fades out the alpha value of any Renderable and Fadeable entity. Once the // object has completely faded out it is destroyed. struct FadeOutSystem : public ex::System<FadeOutSystem> { - void update(ex::EntityManager &es, ex::EventManager &events, DeltaTime dt) override { + void update(ex::EntityManager &es, ex::EventManager &events, ex::DeltaTime dt) override { Fadeable::Handle fade; Renderable::Handle renderable; for (ex::Entity entity : es.entities_with_components(fade, renderable)) { @@ -121,7 +121,7 @@ class BounceSystem : public ex::System<BounceSystem> { public: explicit BounceSystem(sf::RenderTarget &target) : size(target.getSize()) {} - void update(ex::EntityManager &es, ex::EventManager &events, DeltaTime dt) override { + void update(ex::EntityManager &es, ex::EventManager &events, ex::DeltaTime dt) override { Body::Handle body; for (ex::Entity entity : es.entities_with_components(body)) { if (body->position.x + body->direction.x < 0 || @@ -159,7 +159,7 @@ class CollisionSystem : public ex::System<CollisionSystem> { size.y = size.y / PARTITIONS + 1; } - void update(ex::EntityManager &es, ex::EventManager &events, DeltaTime dt) override { + void update(ex::EntityManager &es, ex::EventManager &events, ex::DeltaTime dt) override { reset(); collect(es); collide(events); @@ -226,7 +226,7 @@ public: events.subscribe<CollisionEvent>(*this); } - void update(ex::EntityManager &es, ex::EventManager &events, DeltaTime dt) override { + void update(ex::EntityManager &es, ex::EventManager &events, ex::DeltaTime dt) override { for (ex::Entity entity : collided) { emit_particles(es, entity); entity.destroy(); @@ -285,7 +285,7 @@ public: text.setColor(sf::Color::White); } - void update(ex::EntityManager &es, ex::EventManager &events, DeltaTime dt) override { + void update(ex::EntityManager &es, ex::EventManager &events, ex::DeltaTime dt) override { Body::Handle body; Renderable::Handle renderable; for (ex::Entity entity : es.entities_with_components(body, renderable)) { @@ -341,7 +341,7 @@ public: } } - void update(DeltaTime dt) { + void update(ex::DeltaTime dt) { systems.update<BodySystem>(dt); systems.update<FadeOutSystem>(dt); systems.update<BounceSystem>(dt); |