consolodate NetworkEvents

This commit is contained in:
2025-05-02 00:48:29 -05:00
parent b4ac013f18
commit 6f322cadb8
8 changed files with 129 additions and 242 deletions

View File

@@ -15,191 +15,191 @@ namespace Archimedes {
std::function<void(Event*)> sendEvent;
};
class WindowResizeEvent : public Event {
class ResizeWindowEvent : public Event {
public:
WindowResizeEvent() : width(0), height(0) {}
ResizeWindowEvent() : width(0), height(0) {}
WindowResizeEvent(int w, int h) : width(w), height(h) {}
ResizeWindowEvent(int w, int h) : width(w), height(h) {}
~WindowResizeEvent() {
~ResizeWindowEvent() {
}
operator std::string() const override { return "Archimedes::WindowResizeEvent"; }
operator std::string() const override { return "Archimedes::ResizeWindowEvent"; }
int width, height;
};
class WindowCloseEvent : public Event {
class CloseWindowEvent : public Event {
public:
WindowCloseEvent() : window(nullptr) {}
CloseWindowEvent() : window(nullptr) {}
WindowCloseEvent(const Window* w) : window(w) {}
CloseWindowEvent(const Window* w) : window(w) {}
~WindowCloseEvent() {
~CloseWindowEvent() {
}
operator std::string() const override { return "Archimedes::WindowCloseEvent"; }
operator std::string() const override { return "Archimedes::CloseWindowEvent"; }
const Window* window;
};
class WindowKeyPressedEvent : public Event {
class KeyPressedWindowEvent : public Event {
public:
WindowKeyPressedEvent() : key(0), repeat(0) {}
KeyPressedWindowEvent() : key(0), repeat(0) {}
WindowKeyPressedEvent(unsigned int k, unsigned int r) : key(k), repeat(r) {}
KeyPressedWindowEvent(unsigned int k, unsigned int r) : key(k), repeat(r) {}
~WindowKeyPressedEvent() {
~KeyPressedWindowEvent() {
}
operator std::string() const override { return "Archimedes::WindowKeyPressedEvent"; }
operator std::string() const override { return "Archimedes::KeyPressedWindowEvent"; }
unsigned int key;
unsigned int repeat;
};
class WindowKeyReleasedEvent : public Event {
class KeyReleasedWindowEvent : public Event {
public:
WindowKeyReleasedEvent() : key(0) {}
KeyReleasedWindowEvent() : key(0) {}
WindowKeyReleasedEvent(unsigned int k) : key(k) {}
KeyReleasedWindowEvent(unsigned int k) : key(k) {}
~WindowKeyReleasedEvent() {
~KeyReleasedWindowEvent() {
}
operator std::string() const override { return "Archimedes::WindowKeyReleasedEvent"; }
operator std::string() const override { return "Archimedes::KeyReleasedWindowEvent"; }
unsigned int key;
};
class WindowMouseButtonPressedEvent : public Event {
class MouseButtonPressedWindowEvent : public Event {
public:
WindowMouseButtonPressedEvent() : button(0) {}
MouseButtonPressedWindowEvent() : button(0) {}
WindowMouseButtonPressedEvent(unsigned int b) : button(b) {}
MouseButtonPressedWindowEvent(unsigned int b) : button(b) {}
~WindowMouseButtonPressedEvent() {
~MouseButtonPressedWindowEvent() {
}
operator std::string() const override { return "Archimedes::WindowMouseButtonPressedEvent"; }
operator std::string() const override { return "Archimedes::MouseButtonPressedWindowEvent"; }
unsigned int button;
};
class WindowMouseButtonReleasedEvent : public Event {
class MouseButtonReleasedWindowEvent : public Event {
public:
WindowMouseButtonReleasedEvent() : button(0) {}
MouseButtonReleasedWindowEvent() : button(0) {}
WindowMouseButtonReleasedEvent(unsigned int b) : button(b) {}
MouseButtonReleasedWindowEvent(unsigned int b) : button(b) {}
~WindowMouseButtonReleasedEvent() {
~MouseButtonReleasedWindowEvent() {
}
operator std::string() const override { return "Archimedes::WindowMouseButtonReleasedEvent"; }
operator std::string() const override { return "Archimedes::MouseButtonReleasedWindowEvent"; }
unsigned int button;
};
class WindowScrollEvent : public Event {
class ScrollWindowEvent : public Event {
public:
WindowScrollEvent() : dx(0), dy(0) {}
ScrollWindowEvent() : dx(0), dy(0) {}
WindowScrollEvent(double x, double y) : dx(x), dy(y) {}
ScrollWindowEvent(double x, double y) : dx(x), dy(y) {}
~WindowScrollEvent() {
~ScrollWindowEvent() {
}
operator std::string() const override { return "Archimedes::WindowScrollEvent"; }
operator std::string() const override { return "Archimedes::ScrollWindowEvent"; }
double dx, dy;
};
class WindowMouseMovedEvent : public Event {
class MouseMovedWindowEvent : public Event {
public:
WindowMouseMovedEvent() : x(0), y(0) {}
MouseMovedWindowEvent() : x(0), y(0) {}
WindowMouseMovedEvent(double x, double y) : x(x), y(y) {}
MouseMovedWindowEvent(double x, double y) : x(x), y(y) {}
~WindowMouseMovedEvent() {
~MouseMovedWindowEvent() {
}
operator std::string() const override { return "Archimedes::WindowMouseMovedEvent"; }
operator std::string() const override { return "Archimedes::MouseMovedWindowEvent"; }
double x, y;
};
class WindowFocusedEvent : public Event {
class FocusedWindowEvent : public Event {
public:
WindowFocusedEvent() : window(nullptr) {}
FocusedWindowEvent() : window(nullptr) {}
WindowFocusedEvent(const Window* w) : window(w) {}
FocusedWindowEvent(const Window* w) : window(w) {}
~WindowFocusedEvent() {
~FocusedWindowEvent() {
}
operator std::string() const override { return "Archimedes::WindowFocusedEvent"; }
operator std::string() const override { return "Archimedes::FocusedWindowEvent"; }
const Window* window;
};
class WindowFocusLostEvent : public Event {
class FocusLostWindowEvent : public Event {
public:
WindowFocusLostEvent() : window(nullptr) {}
FocusLostWindowEvent() : window(nullptr) {}
WindowFocusLostEvent(const Window* w) : window(w) {}
FocusLostWindowEvent(const Window* w) : window(w) {}
~WindowFocusLostEvent() {
~FocusLostWindowEvent() {
}
operator std::string() const override { return "Archimedes::WindowFocusLostEvent"; }
operator std::string() const override { return "Archimedes::FocusLostWindowEvent"; }
const Window* window;
};
class WindowMovedEvent : public Event {
class MovedWindowEvent : public Event {
public:
WindowMovedEvent() : x(0), y(0) {}
MovedWindowEvent() : x(0), y(0) {}
WindowMovedEvent(int x, int y) : x(x), y(y) {}
MovedWindowEvent(int x, int y) : x(x), y(y) {}
~WindowMovedEvent() {
~MovedWindowEvent() {
}
operator std::string() const override { return "Archimedes::WindowMovedEvent"; }
operator std::string() const override { return "Archimedes::MovedWindowEvent"; }
int x, y;
};