Class Parser

java.lang.Object
  |
  +--Parser

public class Parser
extends java.lang.Object


Field Summary
 Communication communication
          a new Communication instance
 
Constructor Summary
Parser(Communication communication)
          creates a new Parser instance
 
Method Summary
 void catchBall(double direction)
          Catches the ball in the given direction
 void dash(double power)
          gives a runnig impulse with a given power
 Event event()
          receives the incoming message from server and indicates which type of the event it is
 void init(java.lang.String teamName, int playerNumber)
          sends an init-command to the server
 void kick(double power, double direction)
          Kicks into a given directions with a given power
 void move(double x, double y)
          Places the player to a give position on the field
 void say(double message)
          Says a message, which other players on the field can hear
 char side()
          The current side of the team's own goal
 void turn(double moment)
          Turns the body of the player on the field
 void turnNeck(double moment)
          Turns the head of the player on the field
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

communication

public Communication communication
a new Communication instance
Constructor Detail

Parser

public Parser(Communication communication)
creates a new Parser instance
Parameters:
Communication - a Communication instance
Method Detail

init

public void init(java.lang.String teamName,
                 int playerNumber)
sends an init-command to the server
Parameters:
teamName - the current name of the team
playerNumber - a number of the current player

event

public Event event()
receives the incoming message from server and indicates which type of the event it is
Returns:
an Event object containing server information

dash

public void dash(double power)
gives a runnig impulse with a given power
Parameters:
power - a double value which contains the power of the impulse

kick

public void kick(double power,
                 double direction)
Kicks into a given directions with a given power
Parameters:
power - a double value spesifying the power of the kick
direction - a double value giving the direction of the kick

move

public void move(double x,
                 double y)
Places the player to a give position on the field
Parameters:
x - a double value which gives the position in x direction
y - a double value which gives the position in y direction

turn

public void turn(double moment)
Turns the body of the player on the field
Parameters:
moment - a doublevalue which gives the angle (in degree) relative to the player's body in which he wants to turn

turnNeck

public void turnNeck(double moment)
Turns the head of the player on the field
Parameters:
moment - a double value which gives the angle (in degree) relative to the player's body in which he wants to turn

catchBall

public void catchBall(double direction)
Catches the ball in the given direction
Parameters:
direction - adouble value which gives the angle (in degree) relative to the goalie's body in which he wants to catch the ball

say

public void say(double message)
Says a message, which other players on the field can hear
Parameters:
message - a String value which gives the player' s message that he wants to say

side

public char side()
The current side of the team's own goal
Returns:
a side value which contains the current side of the teams's own goal