Class Player

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

public class Player
extends java.lang.Thread

This is the central class of the Simpleclient. Here, all visual information is evaluated and converted into decisions resp. actions to:

So one limitation is, that the client only can play from left to right

Version:
1.0
Author:
Gerald Kuehne, Markus Beier

Field Summary
private  Actor actor
           
private  int CONNECTED
           
private  int NOT_CONNECTED
           
private  int PLAYING
           
private  Sensor sensor
           
private  int status
           
private  java.lang.String teamName
           
private  ObjectInfo theBall
           
private  ObjectInfo theGoal
           
private  int time
           
 
Fields inherited from class java.lang.Thread
contextClassLoader, daemon, eetop, group, inheritableThreadLocals, inheritedAccessControlContext, MAX_PRIORITY, MIN_PRIORITY, name, NORM_PRIORITY, priority, single_step, stillborn, stopThreadPermission, target, threadInitNumber, threadLocals, threadQ
 
Constructor Summary
Player(java.lang.String servername, int serverport, java.lang.String teamName)
          Creates a new Player instance.
 
Method Summary
static void main(java.lang.String[] args)
          Starts the client
private  void play()
          Processes the information gained and transforms it into a decision/action.
 void run()
          This method had to overwritten from Thread.
 
Methods inherited from class java.lang.Thread
, activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, exit, getContextClassLoader, getName, getPriority, getThreadGroup, init, interrupt, interrupt0, interrupted, isAlive, isDaemon, isInterrupted, isInterrupted, join, join, join, nextThreadNum, registerNatives, resume, resume0, setContextClassLoader, setDaemon, setName, setPriority, setPriority0, sleep, sleep, start, stop, stop, stop0, suspend, suspend0, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

actor

private Actor actor

sensor

private Sensor sensor

teamName

private java.lang.String teamName

NOT_CONNECTED

private final int NOT_CONNECTED

CONNECTED

private final int CONNECTED

PLAYING

private final int PLAYING

status

private int status

theBall

private ObjectInfo theBall

theGoal

private ObjectInfo theGoal

time

private int time
Constructor Detail

Player

public Player(java.lang.String servername,
              int serverport,
              java.lang.String teamName)
Creates a new Player instance.
Parameters:
servername - a String value specifying the the name of the server
serverport - an int value specifying the port on which the server listens for incoming packets
teamName - a String value is the name of the team you want to join/create
Method Detail

run

public void run()
This method had to overwritten from Thread. It is executed when start() is called for the Player Thread
Overrides:
run in class java.lang.Thread

play

private void play()
Processes the information gained and transforms it into a decision/action. It should only be called once per 100ms period, so its proper execution on the server is assured

main

public static void main(java.lang.String[] args)
Starts the client
Parameters:
args - The arguments passed must specify SERVERNAME PORT TEAMNAME in this order.