player
Class Player

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--player.Player
All Implemented Interfaces:
Runnable

public class Player
extends Thread

Class that implements a player in the ICFP-2002 programming contest.

Version:
$Revision: 1.6 $
Author:
Allen D. Ball

Fields inherited from class java.lang.Thread
inheritableThreadLocals, MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY, threadLocals
 
Constructor Summary
Player(World world)
          Creates a player thread.
 
Method Summary
 Connection getConnection()
          Method to get the player's connection.
 PlayerRobot getPlayerRobot()
          Method to get the player's robot.
 World getWorld()
          Method to get the player's world.
 void run()
           
 void setConnection(Connection connection)
          Method to set the player's connection.
 void setGUI(GUI gui)
          Method to set the GUI interface.
 
Methods inherited from class java.lang.Thread
, activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Player

public Player(World world)
Creates a player thread.
Parameters:
world - The world environment of the game.
Method Detail

getWorld

public World getWorld()
Method to get the player's world.
Returns:
The player's world.

getConnection

public Connection getConnection()
Method to get the player's connection.
Returns:
The connection connecting to the game server.

setConnection

public void setConnection(Connection connection)
Method to set the player's connection.
Parameters:
connection - The connection connecting to the game server.

setGUI

public void setGUI(GUI gui)
Method to set the GUI interface. The GUI is notified at end of each turn.
Parameters:
gui - The GUI.

getPlayerRobot

public PlayerRobot getPlayerRobot()
Method to get the player's robot.
Returns:
The player's robot.

run

public void run()
Overrides:
run in class Thread


Copyright 2002 Allen D. Ball. All rights reserved.