|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--WhiteBlackGame
Tic-Tac-Toe Game:
A WhiteBlackGame
object controls the execution of
a game that alternates between 2 players called white and black.
Constructor Summary | |
WhiteBlackGame(Player white,
Player black)
Constructs a game for 2 players, white and black. |
Method Summary | |
Player |
blackPlayer()
Returns the player represented by black. |
abstract boolean |
gameOver()
Returns true if the game is over; otherwise, returns false. |
edu.kzoo.grid.Grid |
getGrid()
Returns the grid in which the game is being played. |
void |
respondToMousePress(edu.kzoo.grid.Location loc)
Handles a mouse click on a location of the grid. |
void |
startGame(edu.kzoo.grid.Grid grid)
Starts or restarts the game. |
Player |
whitePlayer()
Returns the player represented by white. |
boolean |
whitesTurn()
Returns true if it is now white's turn; false otherwise. |
abstract boolean |
whiteWon()
Returns true if the game is over and white won; false otherwise. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public WhiteBlackGame(Player white, Player black)
Method Detail |
public edu.kzoo.grid.Grid getGrid()
startGame
method
is invoked.
public Player whitePlayer()
public Player blackPlayer()
public boolean whitesTurn()
public void startGame(edu.kzoo.grid.Grid grid)
public void respondToMousePress(edu.kzoo.grid.Location loc)
public abstract boolean gameOver()
public abstract boolean whiteWon()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |