Class Player

java.lang.Object
  extended by Player
Direct Known Subclasses:
Bugs, Porky, Random, TFT

public abstract class Player
extends java.lang.Object

Player is an abstract class indicating the functionality of players Concrete extensions can play the tournament


Constructor Summary
Player()
           
 
Method Summary
 java.awt.Image getImage()
          To retrieve the image associated with this player
 java.lang.String getName()
          To retrieve the name of this player
abstract  char play(char[] history)
          To instantiate a player this method must be implemented.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Player

public Player()
Method Detail

getImage

public java.awt.Image getImage()
To retrieve the image associated with this player

Returns:
This player's image

getName

public java.lang.String getName()
To retrieve the name of this player

Returns:
This player's name

play

public abstract char play(char[] history)
To instantiate a player this method must be implemented. How will the player choose if the previous (up to) 3 moves of the opponent against me are given? Note that history[0] is the most recent move (if it exists) Then history[1] is the move before that (if it exists) and history[2] is the move before that (if it exists)

Parameters:
history - An array of up to 3 previous plays by my opponent ('c' or 'd' or ' ' if none)
Returns:
'c' or 'd'