A B D G H M P R S T W

A

addHeaders(Image[]) - Method in class BoardPanel
Add column headers for the playfield

B

BoardFrame - Class in <Unnamed>
BoardFrame holds a BoardPanel
BoardFrame(int, int, Vector<Player>) - Constructor for class BoardFrame
Our only method is this constructor Set a suitable title for the tournament, Get the images from each of the players, Create a BoardPanel with the correct number of squares, Tell the BoardPanel to put in the row and column headers, Then start the play
BoardPanel - Class in <Unnamed>
BoardPanel is the battlefield.
BoardPanel(int, int, Vector<Player>) - Constructor for class BoardPanel
Initialize all the arrays
Bugs - Class in <Unnamed>
Bugs is a concrete class extending Player and always defecting
Bugs() - Constructor for class Bugs
Constructor loads an image and sets the name

D

defeats(int, int) - Method in class BoardPanel
defeats tells if player i beats player j in a random number of games, the number of games is between MIN and MAX

G

Game - Class in <Unnamed>
Game is used to play Prisoner's Dilemma Tournament
Game() - Constructor for class Game
 
getImage() - Method in class Player
To retrieve the image associated with this player
getName() - Method in class Player
To retrieve the name of this player

H

HEIGHT - Static variable in class Game
 

M

main(String[]) - Static method in class Game
Create objects whose names are on commandline,
MAX - Static variable in class BoardPanel
The range of numbers of games conducted between participants
MIN - Static variable in class BoardPanel
 

P

paintComponent(Graphics) - Method in class BoardPanel
Any fancy adjustments to a plain old JPanel can be added here
play() - Method in class BoardPanel
play conducts the whole tournament
play(char[]) - Method in class Bugs
To instantiate a player this method must be implemented.
play(char[]) - Method in class Player
To instantiate a player this method must be implemented.
play(char[]) - Method in class Porky
To instantiate a player this method must be implemented.
play(char[]) - Method in class Random
To instantiate a player this method must be implemented.
play(char[]) - Method in class TFT
To instantiate a player this method must be implemented.
Player - Class in <Unnamed>
Player is an abstract class indicating the functionality of players Concrete extensions can play the tournament
Player() - Constructor for class Player
 
Porky - Class in <Unnamed>
Porky is a concrete class extending Player and always cooperating
Porky() - Constructor for class Porky
Constructor loads an image and sets the name

R

Random - Class in <Unnamed>
Random is a concrete class extending Player and implementing a totally random strategy:
Random() - Constructor for class Random
Constructor loads an image and sets the name

S

setIcon(Image) - Method in class Square
setIcon(Image) will fill the button area with a correctly-scaled image.
Square - Class in <Unnamed>
Square is used to label a row or a column as to who is the player.
Square() - Constructor for class Square
 

T

TFT - Class in <Unnamed>
TFT is a concrete class extending Player and implementing the Tit-for-tat strategy: cooperate on first move, then copy opponent's previous move
TFT() - Constructor for class TFT
Constructor loads an image and sets the name

W

WIDTH - Static variable in class Game
default dimensions for game frame

A B D G H M P R S T W