|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectNaiveCPUPlayer
public class NaiveCPUPlayer
NaiveCPUPlayer is a computer-controlled Player that uses the simplest possible strategy: at each turn, it suggests a randomly-selected BoardPoint to attack.
| Constructor Summary | |
|---|---|
NaiveCPUPlayer()
|
|
| Method Summary | |
|---|---|
BoardPoint |
getNextMove()
Gets the next move this Player wants to execute. |
boolean |
isHuman()
Returns true if this Player is human. |
Ship |
placeOneShip()
This method will randomly place one ship. |
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 NaiveCPUPlayer()
| Method Detail |
|---|
public Ship placeOneShip()
placeOneShip in interface Playerpublic BoardPoint getNextMove()
Player
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 | ||||||||