From a7535d87a738157cfdfd30177828ae87c26ccaaa Mon Sep 17 00:00:00 2001 From: Alec Thomas Date: Sat, 18 Jul 2015 21:22:10 -0400 Subject: Remove ambiguity that old compilers can't resolve. --- examples/example.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'examples') diff --git a/examples/example.cc b/examples/example.cc index 7474f7f..bd049ba 100644 --- a/examples/example.cc +++ b/examples/example.cc @@ -87,7 +87,7 @@ public: void update(ex::EntityManager &es, ex::EventManager &events, ex::TimeDelta dt) override { int c = 0; ex::ComponentHandle collideable; - es.each([&](Collideable&) { ++c; }); + es.each([&](ex::Entity entity, Collideable&) { ++c; }); for (int i = 0; i < count - c; i++) { ex::Entity entity = es.create(); @@ -117,7 +117,7 @@ private: // Updates a body's position and rotation. struct BodySystem : public ex::System { void update(ex::EntityManager &es, ex::EventManager &events, ex::TimeDelta dt) override { - es.each([dt](Body &body) { + es.each([dt](ex::Entity entity, Body &body) { body.position += body.direction * static_cast(dt); body.rotation += body.rotationd * dt; }); @@ -131,7 +131,7 @@ public: explicit BounceSystem(sf::RenderTarget &target) : size(target.getSize()) {} void update(ex::EntityManager &es, ex::EventManager &events, ex::TimeDelta dt) override { - es.each([this](Body &body) { + es.each([this](ex::Entity entity, Body &body) { if (body.position.x + body.direction.x < 0 || body.position.x + body.direction.x >= size.x) body.direction.x = -body.direction.x; @@ -246,7 +246,7 @@ public: void update(ex::EntityManager &es, ex::EventManager &events, ex::TimeDelta dt) override { sf::VertexArray vertices(sf::Quads); - es.each([&vertices](Particle &particle, Body &body) { + es.each([&vertices](ex::Entity entity, Particle &particle, Body &body) { const float r = particle.radius; vertices.append(sf::Vertex(body.position + sf::Vector2f(-r, -r), particle.colour)); vertices.append(sf::Vertex(body.position + sf::Vector2f(r, -r), particle.colour)); @@ -324,7 +324,7 @@ public: } void update(ex::EntityManager &es, ex::EventManager &events, ex::TimeDelta dt) override { - es.each([this](Body &body, Renderable &renderable) { + es.each([this](ex::Entity entity, Body &body, Renderable &renderable) { renderable.shape->setPosition(body.position); renderable.shape->setRotation(body.rotation); target.draw(*renderable.shape.get()); -- cgit v1.2.3