Class Move
java.lang.Object
battleship.Move
- All Implemented Interfaces:
IMove
-
Constructor Summary
ConstructorsConstructorDescriptionMove(int moveNumber, List<IPosition> moveShots, List<IGame.ShotResult> moveResults) -
Method Summary
Modifier and TypeMethodDescriptionintgetShots()processEnemyFire(boolean verbose) Processes the results of enemy fire on the game board, analyzing the outcomes of shots, such as valid shots, repeated shots, missed shots, hits on ships, and sunk ships.toString()
-
Constructor Details
-
Move
-
-
Method Details
-
toString
-
getNumber
-
getShots
-
getShotResults
- Specified by:
getShotResultsin interfaceIMove
-
processEnemyFire
Processes the results of enemy fire on the game board, analyzing the outcomes of shots, such as valid shots, repeated shots, missed shots, hits on ships, and sunk ships. It can also display a detailed summary of the shot results if verbose mode is activated.- Specified by:
processEnemyFirein interfaceIMove- Parameters:
verbose- a boolean indicating whether a detailed summary should be printed to the console for the processed enemy fire data.- Returns:
- a JSON-formatted string that encapsulates the results, including counts of valid shots, repeated shots, missed shots, shots outside the game board, and details of hits and sunk ships.
-