|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface BoardGame
Interface for TicTacToe and Gomoku.
Method Summary | |
---|---|
void |
addObserver(java.util.Observer o)
Add an Observer to be notified of updates. |
Player |
currentPlayer()
Returns which Player must play now. |
int |
get_cols()
Number of columns in this game. |
int |
get_rows()
Number of rows in this game. |
Player |
get(int col,
int row)
Returns the Player who has played at the given position. |
boolean |
inRange(int col,
int row)
The given position is valid. |
Player |
join()
Join this game to play as the returned Player. |
void |
move(int col,
int row,
Player p)
Player p attempts to play at position (col,row). |
java.lang.String |
name()
Return the name of the game. |
boolean |
notOver()
The game is not over. |
boolean |
ready()
Two Players have joined. |
void |
restart()
Restart the game, initializing the state. |
int |
squaresLeft()
The number of squares left unplayed. |
Player |
winner()
Returns the winner of the game. |
Method Detail |
---|
int get_cols()
int get_rows()
Player join()
boolean ready()
Player currentPlayer()
void move(int col, int row, Player p) throws InvalidMoveException
InvalidMoveException
Player winner()
Player get(int col, int row)
boolean notOver()
int squaresLeft()
boolean inRange(int col, int row)
void addObserver(java.util.Observer o)
void restart()
java.lang.String name()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |