Package pp.battleship.game.singlemode
Klasse BattleshipClientConfig
java.lang.Object
pp.util.config.Config
pp.battleship.BattleshipConfig
pp.battleship.game.singlemode.BattleshipClientConfig
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
KonstruktorenKonstruktorBeschreibungCreates a defaultBattleshipClientConfigwith predefined values. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungintgetDelay()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 ofIntPointobjects representing the predefined shooting locations for the RobotClient.booleanDetermines 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, getShipNumsVon Klasse geerbte Methoden pp.util.config.Config
convertToType, readFrom, readFrom, readFromIfExists, toString
-
Konstruktordetails
-
BattleshipClientConfig
public BattleshipClientConfig()Creates a defaultBattleshipClientConfigwith predefined values.
-
-
Methodendetails
-
getRobotTargets
Returns an iterator ofIntPointobjects representing the predefined shooting locations for the RobotClient.- Gibt zurück:
- an iterator of
IntPointrepresenting 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
Returns the file representing the opponent's map.- Gibt zurück:
- the opponent's map file, or
nullif not set.
-
getOwnMap
Returns the file representing the player's own map.- Gibt zurück:
- the player's own map file, or
nullif 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:
trueif the opponent map is set, indicating single mode;falseotherwise.
-