Klasse BattleshipClientConfig

java.lang.Object
pp.util.config.Config
pp.battleship.BattleshipConfig
pp.battleship.game.singlemode.BattleshipClientConfig

public class BattleshipClientConfig extends BattleshipConfig
Class providing access to the Battleship client configuration. Extends BattleshipConfig to include additional properties specific to the client. This class manages configuration settings related to the RobotClient's behavior and the game maps used in single mode.

Note: Attributes of this class should not be marked as final to ensure proper functionality when reading from a properties file.

  • Verschachtelte Klassen - Übersicht

    Von Klasse geerbte verschachtelte Klassen/Schnittstellen pp.util.config.Config

    pp.util.config.Config.Property, pp.util.config.Config.Separator
  • Konstruktorübersicht

    Konstruktoren
    Konstruktor
    Beschreibung
    Creates a default BattleshipClientConfig with predefined values.
  • Methodenübersicht

    Modifizierer und Typ
    Methode
    Beschreibung
    int
    Returns the delay (in milliseconds) between shots by the RobotClient.
    Returns the file representing the opponent's map.
    Returns the file representing the player's own map.
    Returns an iterator of IntPoint objects representing the predefined shooting locations for the RobotClient.
    boolean
    Determines if the game is in single mode based on the presence of an opponent map.

    Von Klasse geerbte Methoden pp.battleship.BattleshipConfig

    getMapHeight, getMapWidth, getPort, getShipNums

    Von Klasse geerbte Methoden pp.util.config.Config

    convertToType, readFrom, readFrom, readFromIfExists, toString

    Von Klasse geerbte Methoden java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Konstruktordetails

    • BattleshipClientConfig

      public BattleshipClientConfig()
      Creates a default BattleshipClientConfig with predefined values.
  • Methodendetails

    • getRobotTargets

      public Iterator<IntPoint> getRobotTargets()
      Returns an iterator of IntPoint objects representing the predefined shooting locations for the RobotClient.
      Gibt zurück:
      an iterator of IntPoint representing the shooting locations.
    • getDelay

      public int getDelay()
      Returns the delay (in milliseconds) between shots by the RobotClient.
      Gibt zurück:
      the delay in milliseconds.
    • getOpponentMap

      public File getOpponentMap()
      Returns the file representing the opponent's map.
      Gibt zurück:
      the opponent's map file, or null if not set.
    • getOwnMap

      public File getOwnMap()
      Returns the file representing the player's own map.
      Gibt zurück:
      the player's own map file, or null if not set.
    • isSingleMode

      public boolean isSingleMode()
      Determines if the game is in single mode based on the presence of an opponent map.
      Gibt zurück:
      true if the opponent map is set, indicating single mode; false otherwise.