|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectHumanPlayer
public class HumanPlayer
HumanPlayer is a Player controlled by a human user sitting at the console.
| Constructor Summary | |
|---|---|
HumanPlayer()
|
|
| Method Summary | |
|---|---|
BoardPoint |
getNextMove()
This method will prompt the user until she enters a string corresponding to a BoardPoint; after she does that, it will return a BoardPoint for that String. |
boolean |
isHuman()
Returns true if this Player is human. |
Ship |
placeOneShip()
This method will prompt the user to place a ship, as per the project writeup. |
void |
setBoard(Grid grid)
Sets the board for this Player to the given Grid. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public HumanPlayer()
| Method Detail |
|---|
public Ship placeOneShip()
placeOneShip in interface Playerpublic BoardPoint getNextMove()
getNextMove in interface Playerpublic boolean isHuman()
Player
isHuman in interface Playerpublic void setBoard(Grid grid)
Player
setBoard in interface Playergrid - this Player's board.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||