From 3004bca85c245c2ec77c4c1bd9343c96191c7ccf Mon Sep 17 00:00:00 2001 From: Clyne Sullivan Date: Sun, 1 Sep 2019 14:45:42 -0400 Subject: made all formatting match --- src/player.cpp | 57 +++++++++++++++++++++++++++++---------------------------- 1 file changed, 29 insertions(+), 28 deletions(-) (limited to 'src/player.cpp') diff --git a/src/player.cpp b/src/player.cpp index 22bd0ef..7d1653e 100644 --- a/src/player.cpp +++ b/src/player.cpp @@ -23,53 +23,54 @@ #include "components/Velocity.hpp" void PlayerSystem::configure([[maybe_unused]] entityx::EntityManager& entities, - entityx::EventManager& events) + entityx::EventManager& events) { - events.subscribe>(*this); - events.subscribe>(*this); - events.subscribe(*this); - events.subscribe(*this); + events.subscribe>(*this); + events.subscribe>(*this); + events.subscribe(*this); + events.subscribe(*this); } void PlayerSystem::update([[maybe_unused]] entityx::EntityManager& entites, - [[maybe_unused]] entityx::EventManager& events, - [[maybe_unused]] entityx::TimeDelta dt) + [[maybe_unused]] entityx::EventManager& events, + [[maybe_unused]] entityx::TimeDelta dt) { } void PlayerSystem::receive(const entityx::ComponentAddedEvent& cae) { - player = cae.entity; + player = cae.entity; } void PlayerSystem::receive(const entityx::ComponentRemovedEvent& cre) { - if (player == cre.entity) - player.invalidate(); + if (player == cre.entity) + player.invalidate(); } void PlayerSystem::receive(const KeyDownEvent& kue) { - if (player.valid()) { - if (kue.sym == SDLK_a) { - if (auto vel = player.component(); vel) - vel->x += GROUND_VELOCITY; - } else if (kue.sym == SDLK_d) { - if (auto vel = player.component(); vel) - vel->x -= GROUND_VELOCITY; - } - } + if (player.valid()) { + if (kue.sym == SDLK_a) { + if (auto vel = player.component(); vel) + vel->x += GROUND_VELOCITY; + } else if (kue.sym == SDLK_d) { + if (auto vel = player.component(); vel) + vel->x -= GROUND_VELOCITY; + } + } } void PlayerSystem::receive(const KeyUpEvent& kue) { - if (player.valid()) { - if (kue.sym == SDLK_a) { - if (auto vel = player.component(); vel) - vel->x -= GROUND_VELOCITY; - } else if (kue.sym == SDLK_d) { - if (auto vel = player.component(); vel) - vel->x += GROUND_VELOCITY; - } - } + if (player.valid()) { + if (kue.sym == SDLK_a) { + if (auto vel = player.component(); vel) + vel->x -= GROUND_VELOCITY; + } else if (kue.sym == SDLK_d) { + if (auto vel = player.component(); vel) + vel->x += GROUND_VELOCITY; + } + } } + -- cgit v1.2.3