|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--roboplayer.core.body.Body
This class represents robot body. It is used to communicate with the server. This class is the only thing which should be changed if we want to move the code to real robot.
Constructor Summary | |
Body(java.net.InetAddress host,
int port)
Standard constructor |
Method Summary | |
void |
addHearListener(HearListener l)
This function registers HearListener interface |
void |
addParamsListener(ParamsListener l)
This function registers ParamsListener interface |
void |
addSeeListener(SeeListener l)
This function registers SeeListener interface |
void |
addTickListener(TickListener l)
This function registers TickListener interface |
void |
bye()
Disconnect from the server |
void |
catchBall(double dir)
This function sends catch command to the server |
void |
changeView(java.lang.String angle,
java.lang.String quality)
This function sends chage_view command to the server |
void |
dash(double power)
This function sends dash command to the server |
double |
getEfford()
Player current efford |
double |
getHeadAngle()
Player head angle |
double |
getLastTurnAngle()
Get information about last turn command which was already send, but which was not included in any visual info yet. |
double |
getSpeed()
Player current speed |
double |
getStamina()
Player current stamina |
java.lang.String |
getViewAngle()
Get information about view angle |
boolean |
init(java.lang.String teamName,
boolean goalie)
Connect to server |
void |
kick(double power,
double direction)
This function sends kick command to the server |
void |
move(double x,
double y)
This function sends move command to the server. |
void |
reconnect(java.lang.String teamName,
int uniformNumber)
Reconnect to the server |
void |
removeHearListener(HearListener l)
This function unregisters HearListener interface |
void |
removeParamsListener(ParamsListener l)
This function unregisters ParamsListener interface |
void |
removeSeeListener(SeeListener l)
This function unregisters SeeListener interface |
void |
removeTickListener(TickListener l)
This function unregisters TickListener interface |
void |
run()
Main loop of the robot. |
void |
say(java.lang.String message)
This function sends say command to the server |
void |
turn(double angle)
This function sends turn command to the server |
void |
turnNeck(double angle)
This function sends turn head command to the server |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Body(java.net.InetAddress host, int port) throws java.net.SocketException
host
- Server hostport
- server port
java.net.SocketException
- when we can't connect to the serverMethod Detail |
public boolean init(java.lang.String teamName, boolean goalie)
teamName
- name of the teamgoalie
- true if goalkeeper
public void reconnect(java.lang.String teamName, int uniformNumber)
teamName
- name of the teamuniformNumber
- player numberpublic void bye()
public double getSpeed()
public double getStamina()
public double getEfford()
public double getHeadAngle()
public double getLastTurnAngle()
public java.lang.String getViewAngle()
public void catchBall(double dir)
catchBall
in interface RobotCommands
dir
- catch directionpublic void changeView(java.lang.String angle, java.lang.String quality)
changeView
in interface RobotCommands
angle
- view anglequality
- view qualitypublic void dash(double power)
dash
in interface RobotCommands
power
- dash powerpublic void kick(double power, double direction)
kick
in interface RobotCommands
power
- kick powerdirection
- kick directionpublic void move(double x, double y)
move
in interface RobotCommands
x
- move robot to this directiony
- move robot to this directionpublic void say(java.lang.String message)
say
in interface RobotCommands
message
- messagepublic void turn(double angle)
turn
in interface RobotCommands
angle
- turn anglepublic void turnNeck(double angle)
turnNeck
in interface RobotCommands
angle
- turn anglepublic void removeTickListener(TickListener l)
l
- listenerpublic void addTickListener(TickListener l)
l
- listenerpublic void removeSeeListener(SeeListener l)
l
- listenerpublic void addSeeListener(SeeListener l)
l
- listenerpublic void removeHearListener(HearListener l)
l
- listenerpublic void addHearListener(HearListener l)
l
- listenerpublic void removeParamsListener(ParamsListener l)
l
- listenerpublic void addParamsListener(ParamsListener l)
l
- listenerpublic void run()
run
in interface java.lang.Runnable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |