// 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.

#pragma once

#include "wpi/driverstation/Gamepad.hpp"
#include "wpi/simulation/GenericHIDSim.hpp"

namespace wpi::sim {

/**
 * Class to control a simulated Gamepad controller.
 */
class GamepadSim : public GenericHIDSim {
 public:
  /**
   * Constructs from a Gamepad object.
   *
   * @param joystick controller to simulate
   */
  explicit GamepadSim(const wpi::Gamepad& joystick);

  /**
   * Constructs from a joystick port number.
   *
   * @param port port number
   */
  explicit GamepadSim(int port);

  /**
   * Set the value of a given button.
   *
   * @param button the button to set
   * @param value the new value
   */
  void SetButton(wpi::Gamepad::Button button, bool value);

  /**
   * Set the value of a given axis.
   *
   * @param axis the axis to set
   * @param value the new value
   */
  void SetAxis(wpi::Gamepad::Axis axis, double value);

  /**
   * Change the left X value of the controller's joystick.
   *
   * @param value the new value
   */
  void SetLeftX(double value);

  /**
   * Change the left Y value of the controller's joystick.
   *
   * @param value the new value
   */
  void SetLeftY(double value);

  /**
   * Change the right X value of the controller's joystick.
   *
   * @param value the new value
   */
  void SetRightX(double value);

  /**
   * Change the right Y value of the controller's joystick.
   *
   * @param value the new value
   */
  void SetRightY(double value);

  /**
   * Change the value of the left trigger axis on the controller.
   *
   * @param value the new value
   */
  void SetLeftTriggerAxis(double value);

  /**
   * Change the value of the right trigger axis on the controller.
   *
   * @param value the new value
   */
  void SetRightTriggerAxis(double value);

  /**
   * Change the value of the Face Down button on the controller.
   *
   * @param value the new value
   */
  void SetFaceDownButton(bool value);

  /**
   * Change the value of the Face Right button on the controller.
   *
   * @param value the new value
   */
  void SetFaceRightButton(bool value);

  /**
   * Change the value of the Face Left button on the controller.
   *
   * @param value the new value
   */
  void SetFaceLeftButton(bool value);

  /**
   * Change the value of the Face Up button on the controller.
   *
   * @param value the new value
   */
  void SetFaceUpButton(bool value);

  /**
   * Change the value of the Back button on the controller.
   *
   * @param value the new value
   */
  void SetBackButton(bool value);

  /**
   * Change the value of the Guide button on the controller.
   *
   * @param value the new value
   */
  void SetGuideButton(bool value);

  /**
   * Change the value of the Start button on the controller.
   *
   * @param value the new value
   */
  void SetStartButton(bool value);

  /**
   * Change the value of the left stick button on the controller.
   *
   * @param value the new value
   */
  void SetLeftStickButton(bool value);

  /**
   * Change the value of the right stick button on the controller.
   *
   * @param value the new value
   */
  void SetRightStickButton(bool value);

  /**
   * Change the value of the right bumper button on the controller.
   *
   * @param value the new value
   */
  void SetLeftBumperButton(bool value);

  /**
   * Change the value of the right bumper button on the controller.
   *
   * @param value the new value
   */
  void SetRightBumperButton(bool value);

  /**
   * Change the value of the D-pad up button on the controller.
   *
   * @param value the new value
   */
  void SetDpadUpButton(bool value);

  /**
   * Change the value of the D-pad down button on the controller.
   *
   * @param value the new value
   */
  void SetDpadDownButton(bool value);

  /**
   * Change the value of the D-pad left button on the controller.
   *
   * @param value the new value
   */
  void SetDpadLeftButton(bool value);

  /**
   * Change the value of the D-pad right button on the controller.
   *
   * @param value the new value
   */
  void SetDpadRightButton(bool value);

  /**
   * Change the value of the Miscellaneous 1 button on the controller.
   *
   * @param value the new value
   */
  void SetMisc1Button(bool value);

  /**
   * Change the value of the Right Paddle 1 button on the controller.
   *
   * @param value the new value
   */
  void SetRightPaddle1Button(bool value);

  /**
   * Change the value of the Left Paddle 1 button on the controller.
   *
   * @param value the new value
   */
  void SetLeftPaddle1Button(bool value);

  /**
   * Change the value of the Right Paddle 2 button on the controller.
   *
   * @param value the new value
   */
  void SetRightPaddle2Button(bool value);

  /**
   * Change the value of the Left Paddle 2 button on the controller.
   *
   * @param value the new value
   */
  void SetLeftPaddle2Button(bool value);

  /**
   * Change the value of the Touchpad button on the controller.
   *
   * @param value the new value
   */
  void SetTouchpadButton(bool value);

  /**
   * Change the value of the Miscellaneous 2 button on the controller.
   *
   * @param value the new value
   */
  void SetMisc2Button(bool value);

  /**
   * Change the value of the Miscellaneous 3 button on the controller.
   *
   * @param value the new value
   */
  void SetMisc3Button(bool value);

  /**
   * Change the value of the Miscellaneous 4 button on the controller.
   *
   * @param value the new value
   */
  void SetMisc4Button(bool value);

  /**
   * Change the value of the Miscellaneous 5 button on the controller.
   *
   * @param value the new value
   */
  void SetMisc5Button(bool value);

  /**
   * Change the value of the Miscellaneous 6 button on the controller.
   *
   * @param value the new value
   */
  void SetMisc6Button(bool value);
};

}  // namespace wpi::sim
