use winit::event::MouseButton;

/// Fired when theres mouse input.
pub struct MouseMotion {
    pub delta_x: f64,
    pub delta_y: f64,
}

impl MouseMotion {
    /// Initializes [`self`] via mouse position deltas.
    pub const fn from_delta(delta_x: f64, delta_y: f64) -> Self {
        Self { delta_x, delta_y }
    }
}

/// Mouse buttons.
pub enum Mouse {
    Left,
    Right,
    Middle,
    Forward,
    Back,
    Unknown,
}

impl From<MouseButton> for Mouse {
    fn from(button: MouseButton) -> Self {
        match button {
            MouseButton::Left => Mouse::Left,
            MouseButton::Right => Mouse::Right,
            MouseButton::Back => Mouse::Back,
            MouseButton::Forward => Mouse::Forward,
            MouseButton::Middle => Mouse::Middle,
            _ => Mouse::Unknown,
        }
    }
}
