|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.lang.Thread | +--Player
This class initializes communication, brain and worldmodel. Brain needs a reference to communication and worldmodel. Worldmodel nees a reference to communication
Field Summary | |
private Brain |
brain
The brain of each player |
private Communication |
communication
The communication of each player |
private PlayerAction |
playerAction
The PlayerAction of each player |
private Worldmodel |
world
The worldmodel of each player |
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)
Creates a new Player instance. |
Method Summary | |
double[] |
bodyDoubleArray()
Should be called from the GUI |
double[][] |
giveWorldData()
Should be called from the GUI. |
java.lang.String[] |
hearStringArray()
Should be called from the GUI |
boolean |
playDirectionRight()
Should be called from the GUI |
void |
run()
Starts the brain |
Methods inherited from class java.lang.Thread |
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private Communication communication
private Brain brain
private Worldmodel world
private PlayerAction playerAction
Constructor Detail |
public Player(java.lang.String servername, int serverport)
Player
instance.servername
- a String
value specifying the name of the serverserverport
- an int
value specifying the port on which the server
listens for incoming packetsMethod Detail |
public double[][] giveWorldData()
double[][]
positions array from the worldmodel.worldmodel.giveData()
public boolean playDirectionRight()
boolean
playdirection form the worldmodel.worldmodel.playDirectionRight()
public double[] bodyDoubleArray()
double[]
body arrray form the worldmodel.worldmodel.bodyDoubleArray()
public java.lang.String[] hearStringArray()
String[]
hear array form the worldmodel.worldmodel.hearStringArray()
public void run()
run
in class java.lang.Thread
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |