From e7377daf2fe3b759fbbf7e57f88c412c3b1cf011 Mon Sep 17 00:00:00 2001 From: Loek Le Blansch Date: Thu, 24 Oct 2024 10:56:19 +0200 Subject: `make format` --- mwe/events/src/event.cpp | 48 ++++++++++++++++++------------------------------ 1 file changed, 18 insertions(+), 30 deletions(-) (limited to 'mwe/events/src/event.cpp') diff --git a/mwe/events/src/event.cpp b/mwe/events/src/event.cpp index fecae76..c0ae9ed 100644 --- a/mwe/events/src/event.cpp +++ b/mwe/events/src/event.cpp @@ -1,56 +1,44 @@ #include "event.h" #include "keyCodes.h" // Event class methods -Event::Event(std::string eventType) { - eventData["eventType"] = eventType; -} +Event::Event(std::string eventType) { eventData["eventType"] = eventType; } -void Event::addArgument(const std::string& key, const std::variant& value) { - eventData[key] = value; +void Event::addArgument(const std::string & key, + const std::variant & value) { + eventData[key] = value; } -std::variant Event::getArgument(const std::string& key) const { - return eventData.at(key); +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::toString() const { - return std::to_string(getEventType()); -} -bool Event::getHandled() const { - return isHandled; + return std::get(eventData.at("eventType")); } +std::string Event::toString() const { return std::to_string(getEventType()); } +bool Event::getHandled() const { return isHandled; } -void Event::markHandled() { - isHandled = true; -} +void Event::markHandled() { isHandled = true; } // KeyPressedEvent class methods KeyPressedEvent::KeyPressedEvent(int keycode) - : Event("KeyPressedEvent"), key(keycode), repeatCount(0) {} + : Event("KeyPressedEvent"), key(keycode), repeatCount(0) {} -Keycode KeyPressedEvent::getKeyCode() const { - return key; -} +Keycode KeyPressedEvent::getKeyCode() const { return key; } -int KeyPressedEvent::getRepeatCount() const { - return repeatCount; -} +int KeyPressedEvent::getRepeatCount() const { return repeatCount; } // KeyReleasedEvent class methods KeyReleasedEvent::KeyReleasedEvent(int keycode) - : Event("KeyReleasedEvent"), key(keycode) {} + : Event("KeyReleasedEvent"), key(keycode) {} -Keycode KeyReleasedEvent::getKeyCode() const { - return key; -} +Keycode KeyReleasedEvent::getKeyCode() const { return key; } // MousePressedEvent class methods MousePressedEvent::MousePressedEvent(int mouseX, int mouseY) - : Event("MousePressedEvent"), mouseX(mouseX), mouseY(mouseY) {} + : Event("MousePressedEvent"), mouseX(mouseX), mouseY(mouseY) {} std::pair MousePressedEvent::getMousePosition() const { - return {mouseX, mouseY}; + return {mouseX, mouseY}; } -- cgit v1.2.3