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

package edu.wpi.first.wpilibj.simulation;

import edu.wpi.first.wpilibj.PS4Controller;

/** Class to control a simulated PS4 controller. */
public class PS4ControllerSim extends GenericHIDSim {
  /**
   * Constructs from a PS4Controller object.
   *
   * @param joystick controller to simulate
   */
  @SuppressWarnings("this-escape")
  public PS4ControllerSim(PS4Controller joystick) {
    super(joystick);
    setAxisCount(6);
    setButtonCount(14);
    setPOVCount(1);
  }

  /**
   * Constructs from a joystick port number.
   *
   * @param port port number
   */
  @SuppressWarnings("this-escape")
  public PS4ControllerSim(int port) {
    super(port);
    setAxisCount(6);
    setButtonCount(14);
    setPOVCount(1);
  }

  /**
   * Change the left X value of the controller's joystick.
   *
   * @param value the new value
   */
  public void setLeftX(double value) {
    setRawAxis(PS4Controller.Axis.kLeftX.value, value);
  }

  /**
   * Change the left Y value of the controller's joystick.
   *
   * @param value the new value
   */
  public void setLeftY(double value) {
    setRawAxis(PS4Controller.Axis.kLeftY.value, value);
  }

  /**
   * Change the right X value of the controller's joystick.
   *
   * @param value the new value
   */
  public void setRightX(double value) {
    setRawAxis(PS4Controller.Axis.kRightX.value, value);
  }

  /**
   * Change the right Y value of the controller's joystick.
   *
   * @param value the new value
   */
  public void setRightY(double value) {
    setRawAxis(PS4Controller.Axis.kRightY.value, value);
  }

  /**
   * Change the value of the left trigger 2 axis on the controller.
   *
   * @param value the new value
   */
  public void setL2Axis(double value) {
    setRawAxis(PS4Controller.Axis.kL2.value, value);
  }

  /**
   * Change the value of the right trigger 2 axis on the controller.
   *
   * @param value the new value
   */
  public void setR2Axis(double value) {
    setRawAxis(PS4Controller.Axis.kR2.value, value);
  }

  /**
   * Change the value of the square button on the controller.
   *
   * @param value the new value
   */
  public void setSquareButton(boolean value) {
    setRawButton(PS4Controller.Button.kSquare.value, value);
  }

  /**
   * Change the value of the cross button on the controller.
   *
   * @param value the new value
   */
  public void setCrossButton(boolean value) {
    setRawButton(PS4Controller.Button.kCross.value, value);
  }

  /**
   * Change the value of the circle button on the controller.
   *
   * @param value the new value
   */
  public void setCircleButton(boolean value) {
    setRawButton(PS4Controller.Button.kCircle.value, value);
  }

  /**
   * Change the value of the triangle button on the controller.
   *
   * @param value the new value
   */
  public void setTriangleButton(boolean value) {
    setRawButton(PS4Controller.Button.kTriangle.value, value);
  }

  /**
   * Change the value of the left trigger 1 button on the controller.
   *
   * @param value the new value
   */
  public void setL1Button(boolean value) {
    setRawButton(PS4Controller.Button.kL1.value, value);
  }

  /**
   * Change the value of the right trigger 1 button on the controller.
   *
   * @param value the new value
   */
  public void setR1Button(boolean value) {
    setRawButton(PS4Controller.Button.kR1.value, value);
  }

  /**
   * Change the value of the left trigger 2 button on the controller.
   *
   * @param value the new value
   */
  public void setL2Button(boolean value) {
    setRawButton(PS4Controller.Button.kL2.value, value);
  }

  /**
   * Change the value of the right trigger 2 button on the controller.
   *
   * @param value the new value
   */
  public void setR2Button(boolean value) {
    setRawButton(PS4Controller.Button.kR2.value, value);
  }

  /**
   * Change the value of the share button on the controller.
   *
   * @param value the new value
   */
  public void setShareButton(boolean value) {
    setRawButton(PS4Controller.Button.kShare.value, value);
  }

  /**
   * Change the value of the options button on the controller.
   *
   * @param value the new value
   */
  public void setOptionsButton(boolean value) {
    setRawButton(PS4Controller.Button.kOptions.value, value);
  }

  /**
   * Change the value of the L3 (left stick) button on the controller.
   *
   * @param value the new value
   */
  public void setL3Button(boolean value) {
    setRawButton(PS4Controller.Button.kL3.value, value);
  }

  /**
   * Change the value of the R3 (right stick) button on the controller.
   *
   * @param value the new value
   */
  public void setR3Button(boolean value) {
    setRawButton(PS4Controller.Button.kR3.value, value);
  }

  /**
   * Change the value of the PlayStation button on the controller.
   *
   * @param value the new value
   */
  public void setPSButton(boolean value) {
    setRawButton(PS4Controller.Button.kPS.value, value);
  }

  /**
   * Change the value of the touchpad button on the controller.
   *
   * @param value the new value
   */
  public void setTouchpadButton(boolean value) {
    setRawButton(PS4Controller.Button.kTouchpad.value, value);
  }

  /**
   * Change the value of the touchpad button on the controller.
   *
   * @param value the new value
   * @deprecated Use {@link setTouchpadButton} instead. This function is deprecated for removal to
   *     make function names consistent to allow the HID classes to be automatically generated.
   */
  @Deprecated(since = "2025", forRemoval = true)
  public void setTouchpad(boolean value) {
    setRawButton(PS4Controller.Button.kTouchpad.value, value);
  }
}
