#ifndef MOUSE_EVENT_HPP
#define MOUSE_EVENT_HPP

#include "open_engine/events/event.hpp"
#include "open_engine/input/mouse_codes.hpp"

namespace OpenEngine {
    class MouseMovedEvent
        : public Event
    {
        public:
            MouseMovedEvent(float mouse_x, float mouse_y) 
                : mouse_x(mouse_x), mouse_y(mouse_y)
            {
            };

            inline float GetX() const { return mouse_x; };
            inline float GetY() const { return mouse_y; };

            std::string ToString() const override;

            EVENT_CLASS_TYPE(MouseMoved)
            EVENT_CLASS_CATEGORY(EventCategoryMouse | EventCategoryInput)

        private:
            float mouse_x, mouse_y;
    };

    class MouseScrolledEvent
        : public Event
    {
        public:
            MouseScrolledEvent(float x_offset, float y_offset)
                : x_offset(x_offset), y_offset(y_offset)
            {
            };

            inline float GetXOffset() const { return x_offset; };
            inline float GetYOffset() const { return y_offset; };

            std::string ToString() const override;

            EVENT_CLASS_TYPE(MouseScrolled)
            EVENT_CLASS_CATEGORY(EventCategoryMouse | EventCategoryInput)

        private:
            float x_offset, y_offset;
    };

    class MouseButtonEvent
        : public Event
	{
        public:
            inline MouseCode GetMouseButton() const { return button; };

            EVENT_CLASS_CATEGORY(EventCategoryMouse | EventCategoryInput)

        protected:
            MouseButtonEvent(MouseCode button)
                : button(button)
            {
            };

            MouseCode button;
    };

	class MouseButtonPressedEvent 
        : public MouseButtonEvent
	{
        public:
            MouseButtonPressedEvent(MouseCode button)
                : MouseButtonEvent(button)
            {
            };

            std::string ToString() const override;

            EVENT_CLASS_TYPE(MouseButtonPressed)
    };

	class MouseButtonReleasedEvent
        : public MouseButtonEvent
	{
        public:
            MouseButtonReleasedEvent(MouseCode button)
                : MouseButtonEvent(button) {};

            std::string ToString() const override;

            EVENT_CLASS_TYPE(MouseButtonReleased)
    };
}

#endif // MOUSE_EVENT_HPP
