Module project.pong

Class Options

java.lang.Object
project.pong.model.Options

public class Options extends Object
The Options class represents the game settings for Pong.
  • Constructor Details

    • Options

      public Options(String player1Name, String player2Name, int scoreToWin, int racketWidth, int racketHeight, double ballSpeed, Double ballIncreaseSpeed)
      Constructs an Options object with the specified parameters.
      Parameters:
      player1Name - The name of player 1.
      player2Name - The name of player 2.
      scoreToWin - The score required to win the game.
      racketWidth - The width of the rackets.
      racketHeight - The height of the rackets.
      ballSpeed - The initial speed of the ball.
      ballIncreaseSpeed - The speed increase factor for the ball.
  • Method Details

    • getPlayer1Name

      public String getPlayer1Name()
      Gets the name of player 1.
      Returns:
      The name of player 1.
    • setPlayer1Name

      public void setPlayer1Name(String player1Name)
      Sets the name of player 1.
      Parameters:
      player1Name - The name of player 1 to set.
    • getPlayer2Name

      public String getPlayer2Name()
      Gets the name of player 2.
      Returns:
      The name of player 2.
    • setPlayer2Name

      public void setPlayer2Name(String player2Name)
      Sets the name of player 2.
      Parameters:
      player2Name - The name of player 2 to set.
    • getScoreToWin

      public int getScoreToWin()
      Gets the score required to win the game.
      Returns:
      The score required to win the game.
    • getRacketWidth

      public int getRacketWidth()
      Gets the width of the rackets.
      Returns:
      The width of the rackets.
    • getRacketHeight

      public int getRacketHeight()
      Gets the height of the rackets.
      Returns:
      The height of the rackets.
    • getBallSpeed

      public double getBallSpeed()
      Gets the initial speed of the ball.
      Returns:
      The initial speed of the ball.
    • getBallIncreaseSpeed

      public Double getBallIncreaseSpeed()
      Gets the speed increase factor for the ball.
      Returns:
      The speed increase factor for the ball.