// Copyright (c) FIRST and other WPILib contributors.
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.

// THIS FILE WAS AUTO-GENERATED BY ./commandsv2/generate_hids.py. DO NOT MODIFY

#include "wpi/commands2/button/CommandNiDsXboxController.hpp"

using namespace wpi::cmd;

CommandNiDsXboxController::CommandNiDsXboxController(int port)
    : CommandGenericHID(port), m_hid{wpi::NiDsXboxController(port)} {}

wpi::NiDsXboxController& CommandNiDsXboxController::GetHID() {
  return m_hid;
}

Trigger CommandNiDsXboxController::A(wpi::EventLoop* loop) const {
  return Button(wpi::NiDsXboxController::Button::kA, loop);
}

Trigger CommandNiDsXboxController::B(wpi::EventLoop* loop) const {
  return Button(wpi::NiDsXboxController::Button::kB, loop);
}

Trigger CommandNiDsXboxController::X(wpi::EventLoop* loop) const {
  return Button(wpi::NiDsXboxController::Button::kX, loop);
}

Trigger CommandNiDsXboxController::Y(wpi::EventLoop* loop) const {
  return Button(wpi::NiDsXboxController::Button::kY, loop);
}

Trigger CommandNiDsXboxController::LeftBumper(wpi::EventLoop* loop) const {
  return Button(wpi::NiDsXboxController::Button::kLeftBumper, loop);
}

Trigger CommandNiDsXboxController::RightBumper(wpi::EventLoop* loop) const {
  return Button(wpi::NiDsXboxController::Button::kRightBumper, loop);
}

Trigger CommandNiDsXboxController::Back(wpi::EventLoop* loop) const {
  return Button(wpi::NiDsXboxController::Button::kBack, loop);
}

Trigger CommandNiDsXboxController::Start(wpi::EventLoop* loop) const {
  return Button(wpi::NiDsXboxController::Button::kStart, loop);
}

Trigger CommandNiDsXboxController::LeftStick(wpi::EventLoop* loop) const {
  return Button(wpi::NiDsXboxController::Button::kLeftStick, loop);
}

Trigger CommandNiDsXboxController::RightStick(wpi::EventLoop* loop) const {
  return Button(wpi::NiDsXboxController::Button::kRightStick, loop);
}

Trigger CommandNiDsXboxController::LeftTrigger(double threshold,
                                           wpi::EventLoop* loop) const {
  return Trigger(loop, [this, threshold] {
    return m_hid.GetLeftTriggerAxis() > threshold;
  });
}

Trigger CommandNiDsXboxController::RightTrigger(double threshold,
                                           wpi::EventLoop* loop) const {
  return Trigger(loop, [this, threshold] {
    return m_hid.GetRightTriggerAxis() > threshold;
  });
}

double CommandNiDsXboxController::GetLeftX() const {
  return m_hid.GetLeftX();
}

double CommandNiDsXboxController::GetRightX() const {
  return m_hid.GetRightX();
}

double CommandNiDsXboxController::GetLeftY() const {
  return m_hid.GetLeftY();
}

double CommandNiDsXboxController::GetRightY() const {
  return m_hid.GetRightY();
}

double CommandNiDsXboxController::GetLeftTriggerAxis() const {
  return m_hid.GetLeftTriggerAxis();
}

double CommandNiDsXboxController::GetRightTriggerAxis() const {
  return m_hid.GetRightTriggerAxis();
}
