import Game;
import Math;

namespace Gamepad {

    class GamepadRawHardwareEvent : Game.Event {
        field device;
        field deviceId;
        field mashyType;
        field mashyIndex;
        field value;
        field isSignificant;
        field hardwareFingerprint;

        constructor(device, mashyType, mashyIndex, value, hardwareFingerprint) : base(Game.EventType.GAMEPAD_HARDWARE) {
            this.device = device;
            this.deviceId = device;
            this.mashyType = mashyType;
            this.mashyIndex = mashyIndex;
            this.value = value;
            if (mashyType == GamepadMashyType.AXIS) {
                this.isSignificant = Math.abs(value) > .5;
            } else {
                this.isSignificant = true;
            }
            this.hardwareFingerprint = hardwareFingerprint;
        }
    }
}
