Overview
Package
Class
Tree
Deprecated
Index
Help
PREV NEXT
FRAMES
NO FRAMES
All Classes
A
B
C
E
G
I
M
N
O
P
R
S
T
U
V
W
A
AbstractBoardGame
- Class in
p2.tictactoe
AbstractBoardGame implements common methods to TicTacToe and Gomoku.
AbstractBoardGame(Player, Player)
- Constructor for class p2.tictactoe.
AbstractBoardGame
The state of the game is represented as 3x3 array of chars marked ' ', 'X', or 'O'.
AbstractBoardGameTest
- Class in
p2.tictactoe
AbstractBoardGameTest(String)
- Constructor for class p2.tictactoe.
AbstractBoardGameTest
addObserver(Observer)
- Method in interface p2.tictactoe.
BoardGame
assertFails(Runnable)
- Method in class p2.tictactoe.
AbstractBoardGameTest
Run a command that should fail.
B
BoardGame
- Interface in
p2.tictactoe
Interface for TicTacToe and Gomoku.
C
checkGame(String, String, String, int)
- Method in class p2.tictactoe.
AbstractBoardGameTest
Run a game with simulated input for X and Y, and check that the winner is as expected.
checkWinner(int, int)
- Method in class p2.tictactoe.
AbstractBoardGame
New algorithm needed for larger boards.
clearImage()
- Method in class p2.tictactoe.gui.
Place
col
- Variable in class p2.tictactoe.
Move
cols_
- Variable in class p2.tictactoe.
AbstractBoardGame
currentPlayer()
- Method in class p2.tictactoe.
AbstractBoardGame
currentPlayer()
- Method in interface p2.tictactoe.
BoardGame
E
err_
- Variable in class p2.tictactoe.
AbstractBoardGameTest
G
game
- Variable in class p2.tictactoe.
AbstractBoardGameTest
game_
- Variable in class p2.tictactoe.
InactivePlayer
GameApplet
- Class in
p2.tictactoe.gui
This class provides a button to instantiate a TicTacToe GameGUI.
GameApplet()
- Constructor for class p2.tictactoe.gui.
GameApplet
GameDriver
- Class in
p2.tictactoe
Driver for TicTacToe.
GameDriver()
- Constructor for class p2.tictactoe.
GameDriver
GameGUI
- Class in
p2.tictactoe.gui
This class implements the view on a TicTacToe game.
GameGUI(String)
- Constructor for class p2.tictactoe.gui.
GameGUI
gameState_
- Variable in class p2.tictactoe.
AbstractBoardGame
get(int, int)
- Method in class p2.tictactoe.
AbstractBoardGame
get(int, int)
- Method in interface p2.tictactoe.
BoardGame
get_cols()
- Method in class p2.tictactoe.
AbstractBoardGame
get_cols()
- Method in interface p2.tictactoe.
BoardGame
get_rows()
- Method in class p2.tictactoe.
AbstractBoardGame
get_rows()
- Method in interface p2.tictactoe.
BoardGame
getCol()
- Method in class p2.tictactoe.gui.
Place
getGame()
- Method in class p2.tictactoe.gui.
GameGUI
getRow()
- Method in class p2.tictactoe.gui.
Place
Called by PlaceListener to determine in which location the mouse has been clicked.
Gomoku
- Class in
p2.tictactoe
Gomoku(Player, Player)
- Constructor for class p2.tictactoe.
Gomoku
GomokuTest
- Class in
p2.tictactoe
GomokuTest(String)
- Constructor for class p2.tictactoe.
GomokuTest
GUIplayer
- Class in
p2.tictactoe.gui
Manage interaction with user.
GUIplayer(char)
- Constructor for class p2.tictactoe.gui.
GUIplayer
I
InactivePlayer
- Class in
p2.tictactoe
Manage interaction with user.
InactivePlayer(char)
- Constructor for class p2.tictactoe.
InactivePlayer
The normal contructor to use.
InactivePlayer()
- Constructor for class p2.tictactoe.
InactivePlayer
Special constructor for the Player representing nobody.
init()
- Method in class p2.tictactoe.
AbstractBoardGame
Subclasses should initialize _rows, _cols and _winningScore
init()
- Method in class p2.tictactoe.
Gomoku
init()
- Method in class p2.tictactoe.gui.
GameApplet
Instantiates the BoardGame, initializes the view components, and connects the view to the model.
init()
- Method in class p2.tictactoe.
TicTacToe
inRange(int, int)
- Method in class p2.tictactoe.
AbstractBoardGame
Needed for getter and setter preconditions.
inRange(int, int)
- Method in interface p2.tictactoe.
BoardGame
InvalidMoveException
- Exception in
p2.tictactoe
InvalidMoveException()
- Constructor for exception p2.tictactoe.
InvalidMoveException
InvalidMoveException(String)
- Constructor for exception p2.tictactoe.
InvalidMoveException
invariant()
- Method in class p2.tictactoe.
AbstractBoardGame
These seem obvious, which is exactly why they should be checked.
isNobody()
- Method in class p2.tictactoe.
InactivePlayer
isNobody()
- Method in interface p2.tictactoe.
Player
M
main(String[])
- Static method in class p2.tictactoe.
GameDriver
main(String[])
- Static method in class p2.tictactoe.
GomokuTest
main(String[])
- Static method in class p2.tictactoe.gui.
GameGUI
main(String[])
- Static method in class p2.tictactoe.
TicTacToeTest
makeGame(Player, Player)
- Method in class p2.tictactoe.
AbstractBoardGameTest
Factory method so subclasses can create other games.
makeGame(Player, Player)
- Method in class p2.tictactoe.
GomokuTest
makeGame(Player, Player)
- Method in class p2.tictactoe.
TicTacToeTest
mark()
- Method in class p2.tictactoe.
InactivePlayer
mark()
- Method in interface p2.tictactoe.
Player
mouseClicked(MouseEvent)
- Method in class p2.tictactoe.gui.
PlaceListener
When the mouse is clicked, we ask the current player to make the corresponding move.
move(int, int, Player)
- Method in class p2.tictactoe.
AbstractBoardGame
Called by the current player.
move(int, int, Player)
- Method in interface p2.tictactoe.
BoardGame
move(int, int)
- Method in class p2.tictactoe.gui.
GUIplayer
Attempt to make the given move in the associated game.
Move
- Class in
p2.tictactoe
Bundles together information about a change of state in a BoardGame.
Move(int, int, Player)
- Constructor for class p2.tictactoe.
Move
move()
- Method in class p2.tictactoe.
StreamPlayer
The Player makes a move by reading a line of text from the input stream, and interpreting it using chess notation, i.e., column is 'a' through 'c' and row is '1' through '3'.
N
nobody_
- Variable in class p2.tictactoe.
AbstractBoardGame
notOver()
- Method in class p2.tictactoe.
AbstractBoardGame
The game is not over as long as there is no winner and somebody can still make a move ...
notOver()
- Method in interface p2.tictactoe.
BoardGame
NullOutputStream
- Class in
p2.tictactoe
Needed for silent testing.
NullOutputStream()
- Constructor for class p2.tictactoe.
NullOutputStream
O
out_
- Variable in class p2.tictactoe.
AbstractBoardGameTest
P
p2.tictactoe
- package p2.tictactoe
p2.tictactoe.gui
- package p2.tictactoe.gui
paint(Graphics)
- Method in class p2.tictactoe.gui.
Place
Draws a box along its edge, and, if an image is defined, draws that too (inset 10% from the border).
Place
- Class in
p2.tictactoe.gui
Represents the view of a single place on the BoardGame.
PlaceListener
- Class in
p2.tictactoe.gui
This class picks up mouse clicks and propogates them to a Player of the BoardGame.
PlaceListener(Place, GameGUI)
- Constructor for class p2.tictactoe.gui.
PlaceListener
player
- Variable in class p2.tictactoe.
Move
Player
- Interface in
p2.tictactoe
Minimal interface for Player classes that get moves from user and forward them to the game.
player_
- Variable in class p2.tictactoe.
AbstractBoardGame
playGame(BoardGame)
- Static method in class p2.tictactoe.
GameDriver
playGame(BoardGame, PrintStream, PrintStream)
- Static method in class p2.tictactoe.
GameDriver
R
readChar()
- Static method in class p2.tictactoe.
GameDriver
row
- Variable in class p2.tictactoe.
Move
rows_
- Variable in class p2.tictactoe.
AbstractBoardGame
run(int, int)
- Method in class p2.tictactoe.
Runner
A Runner runs in some direction (dcol,drow) as far as it can, as long as the pieces on the Board are the same as the home square.
Runner
- Class in
p2.tictactoe
Helper class to find winning scores for BoardGame.
Runner(BoardGame, int, int)
- Constructor for class p2.tictactoe.
Runner
This class does not have any interesting contracts.
S
set(int, int, Player)
- Method in class p2.tictactoe.
AbstractBoardGame
Modifies the state of the game.
setGame(BoardGame)
- Method in class p2.tictactoe.
InactivePlayer
Let this player join a particular game.
setGame(BoardGame)
- Method in interface p2.tictactoe.
Player
Let this player join a particular game.
setMove(Player)
- Method in class p2.tictactoe.gui.
Place
Called when the BoardGame changes state.
setUp()
- Method in class p2.tictactoe.
GomokuTest
setWinner(Player)
- Method in class p2.tictactoe.
AbstractBoardGame
showFeedBack(String)
- Method in class p2.tictactoe.gui.
GameGUI
Displays a feedback string in the associated Label component.
silent()
- Method in class p2.tictactoe.
AbstractBoardGameTest
squaresLeft()
- Method in class p2.tictactoe.
AbstractBoardGame
squaresLeft()
- Method in interface p2.tictactoe.
BoardGame
squaresLeft_
- Variable in class p2.tictactoe.
AbstractBoardGame
StreamPlayer
- Class in
p2.tictactoe
Manage interaction with user.
StreamPlayer(char, BufferedReader)
- Constructor for class p2.tictactoe.
StreamPlayer
Constructor to specify an alternative source of moves (e.g., a test case StringReader).
StreamPlayer(char)
- Constructor for class p2.tictactoe.
StreamPlayer
The normal contructor to use.
StreamPlayer(char, String)
- Constructor for class p2.tictactoe.
StreamPlayer
Special constructor to make a Player that plays a fixed set of moves from a String.
swapTurn()
- Method in class p2.tictactoe.
AbstractBoardGame
T
testBadCol()
- Method in class p2.tictactoe.
GomokuTest
testBadRow()
- Method in class p2.tictactoe.
GomokuTest
testEmptyInput()
- Method in class p2.tictactoe.
GomokuTest
testNoWinner()
- Method in class p2.tictactoe.
TicTacToeTest
testOKinput()
- Method in class p2.tictactoe.
GomokuTest
testOWinReverseDiagonal()
- Method in class p2.tictactoe.
TicTacToeTest
testOWinTopRow()
- Method in class p2.tictactoe.
TicTacToeTest
testState()
- Method in class p2.tictactoe.
TicTacToeTest
Test the getters and setters.
testXWinCentreColumn()
- Method in class p2.tictactoe.
TicTacToeTest
testXWinDiagonal()
- Method in class p2.tictactoe.
TicTacToeTest
testXWinsDiagonal()
- Method in class p2.tictactoe.
GomokuTest
TicTacToe
- Class in
p2.tictactoe
Concrete subclass of AbstractBoardGame.
TicTacToe(Player, Player)
- Constructor for class p2.tictactoe.
TicTacToe
TicTacToeTest
- Class in
p2.tictactoe
Test cases for TicTacToe.
TicTacToeTest(String)
- Constructor for class p2.tictactoe.
TicTacToeTest
toString()
- Method in class p2.tictactoe.
AbstractBoardGame
A plain ascii representation of the game, mainly for debugging purposes.
toString()
- Method in class p2.tictactoe.
InactivePlayer
toString()
- Method in class p2.tictactoe.
Move
turn_
- Variable in class p2.tictactoe.
AbstractBoardGame
U
update(Observable, Object)
- Method in class p2.tictactoe.gui.
GameGUI
Implements the java.util.Observer interface.
V
verbose()
- Method in class p2.tictactoe.
AbstractBoardGameTest
W
winner()
- Method in class p2.tictactoe.
AbstractBoardGame
winner()
- Method in interface p2.tictactoe.
BoardGame
winner_
- Variable in class p2.tictactoe.
AbstractBoardGame
winningScore_
- Variable in class p2.tictactoe.
AbstractBoardGame
write(int)
- Method in class p2.tictactoe.
NullOutputStream
Null implementation of inherited abstract method
A
B
C
E
G
I
M
N
O
P
R
S
T
U
V
W
Overview
Package
Class
Tree
Deprecated
Index
Help
PREV NEXT
FRAMES
NO FRAMES
All Classes