Othello 1.0

edu.drexel.cs.ai.othello
Class ConsoleUserInterface

java.lang.Object
  extended by edu.drexel.cs.ai.othello.ConsoleUserInterface
All Implemented Interfaces:
UserInterface

public class ConsoleUserInterface
extends java.lang.Object
implements UserInterface

A text-based user interface that allows for execution in a headless environment.

Author:
Evan A. Sultanik

Constructor Summary
ConsoleUserInterface()
           
 
Method Summary
 OthelloPlayer[] getPlayers()
          Prints all classes that are instanceof OthelloPlayer that have been found in the classpath and then calls System.exit(1).
 void handleStateUpdate(GameState newState)
          Callback function for receiving updates to the state of the game.
 void setPlayers(OthelloPlayer player1, OthelloPlayer player2)
          Assigns the agents that will be playing the current game.
 void updateTimeRemaining(OthelloPlayer player, int secondsRemaining)
          Callback function for updating the amount of time that remains before a player's deadline.
 void updateTimeUsed(OthelloPlayer player, long millisUsed)
          Callback function for updating the total amount of time (in milliseconds) a player has used thus far in the game.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConsoleUserInterface

public ConsoleUserInterface()
Method Detail

handleStateUpdate

public void handleStateUpdate(GameState newState)
Description copied from interface: UserInterface
Callback function for receiving updates to the state of the game.

Specified by:
handleStateUpdate in interface UserInterface

getPlayers

public OthelloPlayer[] getPlayers()
Prints all classes that are instanceof OthelloPlayer that have been found in the classpath and then calls System.exit(1).

Specified by:
getPlayers in interface UserInterface

setPlayers

public void setPlayers(OthelloPlayer player1,
                       OthelloPlayer player2)
Description copied from interface: UserInterface
Assigns the agents that will be playing the current game.

Specified by:
setPlayers in interface UserInterface

updateTimeRemaining

public void updateTimeRemaining(OthelloPlayer player,
                                int secondsRemaining)
Description copied from interface: UserInterface
Callback function for updating the amount of time that remains before a player's deadline.

Specified by:
updateTimeRemaining in interface UserInterface
secondsRemaining - The amount of time in seconds before the end of player's deadline. A negative value indicates that the player has an infinite deadline.

updateTimeUsed

public void updateTimeUsed(OthelloPlayer player,
                           long millisUsed)
Description copied from interface: UserInterface
Callback function for updating the total amount of time (in milliseconds) a player has used thus far in the game.

Specified by:
updateTimeUsed in interface UserInterface

Othello 1.0

Copyright 2006–2007 Evan A. Sultanik