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

#include "wpi/driverstation/NiDsStadiaController.hpp"

#include "wpi/hal/UsageReporting.hpp"
#include "wpi/util/sendable/SendableBuilder.hpp"

#include "wpi/event/BooleanEvent.hpp"

using namespace wpi;

NiDsStadiaController::NiDsStadiaController(int port) : GenericHID(port) {
  HAL_ReportUsage("HID", port, "NiDsStadiaController");
}

double NiDsStadiaController::GetLeftX() const {
  return GetRawAxis(Axis::kLeftX);
}

double NiDsStadiaController::GetRightX() const {
  return GetRawAxis(Axis::kRightX);
}

double NiDsStadiaController::GetLeftY() const {
  return GetRawAxis(Axis::kLeftY);
}

double NiDsStadiaController::GetRightY() const {
  return GetRawAxis(Axis::kRightY);
}

bool NiDsStadiaController::GetAButton() const {
  return GetRawButton(Button::kA);
}

bool NiDsStadiaController::GetAButtonPressed() {
  return GetRawButtonPressed(Button::kA);
}

bool NiDsStadiaController::GetAButtonReleased() {
  return GetRawButtonReleased(Button::kA);
}

BooleanEvent NiDsStadiaController::A(EventLoop* loop) const {
  return BooleanEvent(loop, [this]() { return this->GetAButton(); });
}

bool NiDsStadiaController::GetBButton() const {
  return GetRawButton(Button::kB);
}

bool NiDsStadiaController::GetBButtonPressed() {
  return GetRawButtonPressed(Button::kB);
}

bool NiDsStadiaController::GetBButtonReleased() {
  return GetRawButtonReleased(Button::kB);
}

BooleanEvent NiDsStadiaController::B(EventLoop* loop) const {
  return BooleanEvent(loop, [this]() { return this->GetBButton(); });
}

bool NiDsStadiaController::GetXButton() const {
  return GetRawButton(Button::kX);
}

bool NiDsStadiaController::GetXButtonPressed() {
  return GetRawButtonPressed(Button::kX);
}

bool NiDsStadiaController::GetXButtonReleased() {
  return GetRawButtonReleased(Button::kX);
}

BooleanEvent NiDsStadiaController::X(EventLoop* loop) const {
  return BooleanEvent(loop, [this]() { return this->GetXButton(); });
}

bool NiDsStadiaController::GetYButton() const {
  return GetRawButton(Button::kY);
}

bool NiDsStadiaController::GetYButtonPressed() {
  return GetRawButtonPressed(Button::kY);
}

bool NiDsStadiaController::GetYButtonReleased() {
  return GetRawButtonReleased(Button::kY);
}

BooleanEvent NiDsStadiaController::Y(EventLoop* loop) const {
  return BooleanEvent(loop, [this]() { return this->GetYButton(); });
}

bool NiDsStadiaController::GetLeftBumperButton() const {
  return GetRawButton(Button::kLeftBumper);
}

bool NiDsStadiaController::GetLeftBumperButtonPressed() {
  return GetRawButtonPressed(Button::kLeftBumper);
}

bool NiDsStadiaController::GetLeftBumperButtonReleased() {
  return GetRawButtonReleased(Button::kLeftBumper);
}

BooleanEvent NiDsStadiaController::LeftBumper(EventLoop* loop) const {
  return BooleanEvent(loop, [this]() { return this->GetLeftBumperButton(); });
}

bool NiDsStadiaController::GetRightBumperButton() const {
  return GetRawButton(Button::kRightBumper);
}

bool NiDsStadiaController::GetRightBumperButtonPressed() {
  return GetRawButtonPressed(Button::kRightBumper);
}

bool NiDsStadiaController::GetRightBumperButtonReleased() {
  return GetRawButtonReleased(Button::kRightBumper);
}

BooleanEvent NiDsStadiaController::RightBumper(EventLoop* loop) const {
  return BooleanEvent(loop, [this]() { return this->GetRightBumperButton(); });
}

bool NiDsStadiaController::GetLeftStickButton() const {
  return GetRawButton(Button::kLeftStick);
}

bool NiDsStadiaController::GetLeftStickButtonPressed() {
  return GetRawButtonPressed(Button::kLeftStick);
}

bool NiDsStadiaController::GetLeftStickButtonReleased() {
  return GetRawButtonReleased(Button::kLeftStick);
}

BooleanEvent NiDsStadiaController::LeftStick(EventLoop* loop) const {
  return BooleanEvent(loop, [this]() { return this->GetLeftStickButton(); });
}

bool NiDsStadiaController::GetRightStickButton() const {
  return GetRawButton(Button::kRightStick);
}

bool NiDsStadiaController::GetRightStickButtonPressed() {
  return GetRawButtonPressed(Button::kRightStick);
}

bool NiDsStadiaController::GetRightStickButtonReleased() {
  return GetRawButtonReleased(Button::kRightStick);
}

BooleanEvent NiDsStadiaController::RightStick(EventLoop* loop) const {
  return BooleanEvent(loop, [this]() { return this->GetRightStickButton(); });
}

bool NiDsStadiaController::GetEllipsesButton() const {
  return GetRawButton(Button::kEllipses);
}

bool NiDsStadiaController::GetEllipsesButtonPressed() {
  return GetRawButtonPressed(Button::kEllipses);
}

bool NiDsStadiaController::GetEllipsesButtonReleased() {
  return GetRawButtonReleased(Button::kEllipses);
}

BooleanEvent NiDsStadiaController::Ellipses(EventLoop* loop) const {
  return BooleanEvent(loop, [this]() { return this->GetEllipsesButton(); });
}

bool NiDsStadiaController::GetHamburgerButton() const {
  return GetRawButton(Button::kHamburger);
}

bool NiDsStadiaController::GetHamburgerButtonPressed() {
  return GetRawButtonPressed(Button::kHamburger);
}

bool NiDsStadiaController::GetHamburgerButtonReleased() {
  return GetRawButtonReleased(Button::kHamburger);
}

BooleanEvent NiDsStadiaController::Hamburger(EventLoop* loop) const {
  return BooleanEvent(loop, [this]() { return this->GetHamburgerButton(); });
}

bool NiDsStadiaController::GetStadiaButton() const {
  return GetRawButton(Button::kStadia);
}

bool NiDsStadiaController::GetStadiaButtonPressed() {
  return GetRawButtonPressed(Button::kStadia);
}

bool NiDsStadiaController::GetStadiaButtonReleased() {
  return GetRawButtonReleased(Button::kStadia);
}

BooleanEvent NiDsStadiaController::Stadia(EventLoop* loop) const {
  return BooleanEvent(loop, [this]() { return this->GetStadiaButton(); });
}

bool NiDsStadiaController::GetRightTriggerButton() const {
  return GetRawButton(Button::kRightTrigger);
}

bool NiDsStadiaController::GetRightTriggerButtonPressed() {
  return GetRawButtonPressed(Button::kRightTrigger);
}

bool NiDsStadiaController::GetRightTriggerButtonReleased() {
  return GetRawButtonReleased(Button::kRightTrigger);
}

BooleanEvent NiDsStadiaController::RightTrigger(EventLoop* loop) const {
  return BooleanEvent(loop, [this]() { return this->GetRightTriggerButton(); });
}

bool NiDsStadiaController::GetLeftTriggerButton() const {
  return GetRawButton(Button::kLeftTrigger);
}

bool NiDsStadiaController::GetLeftTriggerButtonPressed() {
  return GetRawButtonPressed(Button::kLeftTrigger);
}

bool NiDsStadiaController::GetLeftTriggerButtonReleased() {
  return GetRawButtonReleased(Button::kLeftTrigger);
}

BooleanEvent NiDsStadiaController::LeftTrigger(EventLoop* loop) const {
  return BooleanEvent(loop, [this]() { return this->GetLeftTriggerButton(); });
}

bool NiDsStadiaController::GetGoogleButton() const {
  return GetRawButton(Button::kGoogle);
}

bool NiDsStadiaController::GetGoogleButtonPressed() {
  return GetRawButtonPressed(Button::kGoogle);
}

bool NiDsStadiaController::GetGoogleButtonReleased() {
  return GetRawButtonReleased(Button::kGoogle);
}

BooleanEvent NiDsStadiaController::Google(EventLoop* loop) const {
  return BooleanEvent(loop, [this]() { return this->GetGoogleButton(); });
}

bool NiDsStadiaController::GetFrameButton() const {
  return GetRawButton(Button::kFrame);
}

bool NiDsStadiaController::GetFrameButtonPressed() {
  return GetRawButtonPressed(Button::kFrame);
}

bool NiDsStadiaController::GetFrameButtonReleased() {
  return GetRawButtonReleased(Button::kFrame);
}

BooleanEvent NiDsStadiaController::Frame(EventLoop* loop) const {
  return BooleanEvent(loop, [this]() { return this->GetFrameButton(); });
}

void NiDsStadiaController::InitSendable(wpi::util::SendableBuilder& builder) {
  builder.SetSmartDashboardType("HID");
  builder.PublishConstString("ControllerType", "NiDsStadia");
  builder.AddDoubleProperty("LeftX", [this] { return GetLeftX(); }, nullptr);
  builder.AddDoubleProperty("RightX", [this] { return GetRightX(); }, nullptr);
  builder.AddDoubleProperty("LeftY", [this] { return GetLeftY(); }, nullptr);
  builder.AddDoubleProperty("RightY", [this] { return GetRightY(); }, nullptr);
  builder.AddBooleanProperty("A", [this] { return GetAButton(); }, nullptr);
  builder.AddBooleanProperty("B", [this] { return GetBButton(); }, nullptr);
  builder.AddBooleanProperty("X", [this] { return GetXButton(); }, nullptr);
  builder.AddBooleanProperty("Y", [this] { return GetYButton(); }, nullptr);
  builder.AddBooleanProperty("LeftBumper", [this] { return GetLeftBumperButton(); }, nullptr);
  builder.AddBooleanProperty("RightBumper", [this] { return GetRightBumperButton(); }, nullptr);
  builder.AddBooleanProperty("LeftStick", [this] { return GetLeftStickButton(); }, nullptr);
  builder.AddBooleanProperty("RightStick", [this] { return GetRightStickButton(); }, nullptr);
  builder.AddBooleanProperty("Ellipses", [this] { return GetEllipsesButton(); }, nullptr);
  builder.AddBooleanProperty("Hamburger", [this] { return GetHamburgerButton(); }, nullptr);
  builder.AddBooleanProperty("Stadia", [this] { return GetStadiaButton(); }, nullptr);
  builder.AddBooleanProperty("RightTrigger", [this] { return GetRightTriggerButton(); }, nullptr);
  builder.AddBooleanProperty("LeftTrigger", [this] { return GetLeftTriggerButton(); }, nullptr);
  builder.AddBooleanProperty("Google", [this] { return GetGoogleButton(); }, nullptr);
  builder.AddBooleanProperty("Frame", [this] { return GetFrameButton(); }, nullptr);
}