From f51ddfac7b8948a43a40894185238c8a1ceeb5c4 Mon Sep 17 00:00:00 2001 From: Loek Le Blansch Date: Fri, 15 Nov 2024 17:25:12 +0100 Subject: wrap lines at column 95 instead of 80 --- mwe/events/src/event.cpp | 35 +++++++++-------------------------- 1 file changed, 9 insertions(+), 26 deletions(-) (limited to 'mwe/events/src/event.cpp') diff --git a/mwe/events/src/event.cpp b/mwe/events/src/event.cpp index 8ffa0b1..0040c73 100644 --- a/mwe/events/src/event.cpp +++ b/mwe/events/src/event.cpp @@ -8,14 +8,11 @@ void Event::addArgument(const std::string & key, eventData[key] = value; } -std::variant -Event::getArgument(const std::string & key) const { +std::variant Event::getArgument(const std::string & key) const { return eventData.at(key); } -std::string Event::getType() const { - return std::get(eventData.at("eventType")); -} +std::string Event::getType() const { return std::get(eventData.at("eventType")); } std::string Event::toString() const { return std::to_string(getEventType()); } bool Event::getHandled() const { return isHandled; } @@ -32,9 +29,7 @@ Keycode KeyPressedEvent::getKeyCode() const { return key; } int KeyPressedEvent::getRepeatCount() const { return repeatCount; } // KeyReleasedEvent class methods -KeyReleasedEvent::KeyReleasedEvent(int keycode) - : Event("KeyReleasedEvent"), - key(keycode) {} +KeyReleasedEvent::KeyReleasedEvent(int keycode) : Event("KeyReleasedEvent"), key(keycode) {} Keycode KeyReleasedEvent::getKeyCode() const { return key; } @@ -44,22 +39,16 @@ MousePressedEvent::MousePressedEvent(int mouseX, int mouseY) mouseX(mouseX), mouseY(mouseY) {} -std::pair MousePressedEvent::getMousePosition() const { - return {mouseX, mouseY}; -} +std::pair MousePressedEvent::getMousePosition() const { return {mouseX, mouseY}; } //Collision event CollisionEvent::CollisionEvent(Collision collision) : collisionData(collision), Event("CollisionEvent") {} -Collision CollisionEvent::getCollisionData() const { - return this->collisionData; -} +Collision CollisionEvent::getCollisionData() const { return this->collisionData; } -TextSubmitEvent::TextSubmitEvent(std::string text) - : text(text), - Event("TextSubmitEvent") {} +TextSubmitEvent::TextSubmitEvent(std::string text) : text(text), Event("TextSubmitEvent") {} std::string TextSubmitEvent::getText() const { return this->text; } @@ -68,9 +57,7 @@ MouseReleasedEvent::MouseReleasedEvent(int x, int y, MouseButton button) mouseY(y), button(button), Event("MouseReleased") {} -std::pair MouseReleasedEvent::getMousePosition() const { - return {mouseX, mouseY}; -} +std::pair MouseReleasedEvent::getMousePosition() const { return {mouseX, mouseY}; } MouseClickEvent::MouseClickEvent(int x, int y, MouseButton button) : mouseX(x), mouseY(y), @@ -80,9 +67,5 @@ MouseMovedEvent::MouseMovedEvent(int x, int y) : mouseX(x), mouseY(y), Event("MouseMovedEvent") {} -std::pair MouseClickEvent::getMousePosition() const { - return {mouseX, mouseY}; -} -std::pair MouseMovedEvent::getMousePosition() const { - return {mouseX, mouseY}; -} +std::pair MouseClickEvent::getMousePosition() const { return {mouseX, mouseY}; } +std::pair MouseMovedEvent::getMousePosition() const { return {mouseX, mouseY}; } -- cgit v1.2.3