|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectBattleship
Details of the current game
Field Summary | |
private ShipBoard |
comp
Computer's ship board |
private GuessBoard |
user
User's guess board |
private boolean |
win
Status of the game : true when user has won |
Constructor Summary | |
(package private) |
Battleship()
Initialize the game. |
Method Summary | |
int[] |
compStat()
|
int |
guessStatus(Location l)
Get the results of user's guess. |
int |
numUserGuess()
|
int |
userGuess(Location l)
Carry out the user's guess, by modifying the shipBoard and guessBoard |
boolean |
win()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private ShipBoard comp
private GuessBoard user
private boolean win
Constructor Detail |
Battleship()
Method Detail |
public int guessStatus(Location l)
l
- Location to be queried
public int userGuess(Location l)
l
- Location that the user guesses
public int[] compStat()
public int numUserGuess()
public boolean win()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |