using InControl;
using UnityEngine;

public class ControllerWrapper : InputWrapper
{
    public InputDevice InputDevice { get; private set; }

    public ControllerWrapper(InputDevice device)
    {
        this.InputDevice = device;
    }

    public override Vector2 Direction()
    {
        return InputDevice != null ? InputDevice.LeftStick.Vector : Vector2.zero;
    }
    public override Vector2 Aim()
    {
        return InputDevice != null ? InputDevice.RightStick.Vector : Vector2.zero;
    }

    public override bool Cross()
    {
        return InputDevice != null ? InputDevice.Action1.WasPressed : false;
    }

    public override bool CrossUp()
    {
        return InputDevice != null ? InputDevice.Action1.WasReleased : false;
    }

    public override bool Square()
    {
        return InputDevice != null ? InputDevice.Action3.WasPressed : false;
    }

    public override bool Triangle()
    {
        return InputDevice != null ? InputDevice.Action4.WasPressed : false;
    }

    public override bool Circle()
    {
        return InputDevice != null ? InputDevice.Action2.WasPressed : false;
    }
}