// 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 ./wpilibNewCommands/generate_hids.py. DO NOT MODIFY

#include "frc2/command/button/CommandXboxController.h"

using namespace frc2;

CommandXboxController::CommandXboxController(int port)
    : CommandGenericHID(port), m_hid{frc::XboxController(port)} {}

frc::XboxController& CommandXboxController::GetHID() {
  return m_hid;
}

Trigger CommandXboxController::A(frc::EventLoop* loop) const {
  return Button(frc::XboxController::Button::kA, loop);
}

Trigger CommandXboxController::B(frc::EventLoop* loop) const {
  return Button(frc::XboxController::Button::kB, loop);
}

Trigger CommandXboxController::X(frc::EventLoop* loop) const {
  return Button(frc::XboxController::Button::kX, loop);
}

Trigger CommandXboxController::Y(frc::EventLoop* loop) const {
  return Button(frc::XboxController::Button::kY, loop);
}

Trigger CommandXboxController::LeftBumper(frc::EventLoop* loop) const {
  return Button(frc::XboxController::Button::kLeftBumper, loop);
}

Trigger CommandXboxController::RightBumper(frc::EventLoop* loop) const {
  return Button(frc::XboxController::Button::kRightBumper, loop);
}

Trigger CommandXboxController::Back(frc::EventLoop* loop) const {
  return Button(frc::XboxController::Button::kBack, loop);
}

Trigger CommandXboxController::Start(frc::EventLoop* loop) const {
  return Button(frc::XboxController::Button::kStart, loop);
}

Trigger CommandXboxController::LeftStick(frc::EventLoop* loop) const {
  return Button(frc::XboxController::Button::kLeftStick, loop);
}

Trigger CommandXboxController::RightStick(frc::EventLoop* loop) const {
  return Button(frc::XboxController::Button::kRightStick, loop);
}

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

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

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

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

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

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

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

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