namespace RioJoy.Core.Calibration;

/// <summary>
/// The six calibrated virtual-joystick axis values, each in the documented range
/// <c>0..32766</c> (center 16383). Output of <see cref="AxisCalibrator"/>; fed to
/// the virtual HID device (<c>HID_USAGE_X..RZ</c> in the legacy).
/// </summary>
public readonly struct AxisOutputs
{
    /// <summary>Documented axis range maximum (legacy uses 0..32766).</summary>
    public const int Max = 32766;

    /// <summary>Documented axis center value.</summary>
    public const int Center = 16383;

    public int X { get; }
    public int Y { get; }
    public int Z { get; }
    public int Rx { get; }
    public int Ry { get; }
    public int Rz { get; }

    public AxisOutputs(int x, int y, int z, int rx, int ry, int rz)
    {
        X = x;
        Y = y;
        Z = z;
        Rx = rx;
        Ry = ry;
        Rz = rz;
    }

    public override string ToString() => $"X:{X} Y:{Y} Z:{Z} Rx:{Rx} Ry:{Ry} Rz:{Rz}";
}

/// <summary>The six virtual-joystick axes.</summary>
public enum JoyAxis
{
    X,
    Y,
    Z,
    Rx,
    Ry,
    Rz,
}
