Class Player

java.lang.Object
  |
  +--Player

public class Player
extends java.lang.Object

Manage interaction with user.

Version:
1.5 1999-02-07
Author:
Oscar.Nierstrasz@acm.org

Constructor Summary
Player()
          Special constructor for the Player representing nobody.
Player(char mark)
          The normal contructor to use:
Player(char mark, java.io.BufferedReader in)
          Constructor to specify an alternative source of moves (e.g., a test case StringReader).
Player(char mark, java.lang.String moves)
          Special constructor to make a Player that plays a fixed set of moves from a String.
 
Method Summary
 boolean isNobody()
          By convention, a Player without a mark is nobody!
 char mark()
           
 void move(BoardGame game)
           
 java.lang.String name()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Player

public Player(char mark,
              java.io.BufferedReader in)
Constructor to specify an alternative source of moves (e.g., a test case StringReader).

Player

public Player(char mark)
The normal contructor to use:

Player

public Player(char mark,
              java.lang.String moves)
Special constructor to make a Player that plays a fixed set of moves from a String. Used to define test cases.

Player

public Player()
Special constructor for the Player representing nobody. (Used by TicTacToe as a placeholder when there is no winner yet.)
Method Detail

mark

public char mark()

name

public java.lang.String name()

isNobody

public boolean isNobody()
By convention, a Player without a mark is nobody!

move

public void move(BoardGame game)
          throws java.io.IOException