Package student.micro.battleship
Class GameState
java.lang.Object
student.micro.battleship.GameState
- Direct Known Subclasses:
TestableGameState
Represents the state of a game of "Battleship", including both players'
boards.
-
Constructor Details
-
GameState
public GameState()Create a new game state, with two empty boards.
-
-
Method Details
-
getMyBoard
Get my board from the game state.- Returns:
- My board.
-
getOpponentsBoard
Get my opponent's board from the game state.- Returns:
- My opponent's board.
-
getRound
public int getRound()Get this game's current round number (the number of shots fired by both players so far).- Returns:
- This game's round number.
-
toString
-