ProgrammierMethodik 2002 - RoboCup

Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

RCCommunicator Class Reference

This class id for the connection to the server. More...

Inheritance diagram for RCCommunicator::

RCEventType RCSender RCType RCView RCPlayMode List of all members.

Public Methods

 RCCommunicator (String Team, RCWorld World, boolean Goalie, String Host, int Port)
 Constructor for RCCommunicator oject. More...

boolean receive ()
 receive a package, and do a cycle. More...

void turn (double Movement)
 send a move message to the server. More...

void dash (double Power)
 send a dash message to the server. More...

void kick (double Power, double Direction)
 send a kick message to the server. More...

void catchit (double Direction)
 send a catch message to the server. More...

void move (double x, double y)
 send a move message to the server. More...

void turn_neck (double Angle)
 Send a turn_neck message to the sever. More...

void say (String Message)
 Send a say message to the server, with World.MsgStart as prefix. More...

void sence_body ()
 Send a body_sence message to the server. More...

void send (String Message)
 This function sends a message to the server. More...


Public Attributes

String Host
 Attributes. More...

int ServerPort
String Team
int PlayerNumber
RCPlayMode PlayMode
boolean Goalie
DatagramSocket Sock
InetAddress Address

Private Attributes

RCParser Parser
 Associations. More...

RCWorld World

Detailed Description

This class id for the connection to the server.

It log on to the server and receive the messages from the server. It use the RCParser class for parsing and delivering the servermessages.

Definition at line 67 of file RCCommunicator.java.


Constructor & Destructor Documentation

RCCommunicator::RCCommunicator ( String Team,
RCWorld World,
boolean Goalie,
String Host,
int Port ) [inline]
 

Constructor for RCCommunicator oject.

Parameters:
Team   name of the team
World   referenz to the world object
Goalie   are we a goalie
Host   name of the server hostname
Port   port of the server

Definition at line 91 of file RCCommunicator.java.


Member Function Documentation

void RCCommunicator::catchit ( double Direction ) [inline]
 

send a catch message to the server.

Parameters:
Direction   the direction to catch

Definition at line 208 of file RCCommunicator.java.

Referenced by RCGoalieBrain::update().

void RCCommunicator::dash ( double Power ) [inline]
 

send a dash message to the server.

Parameters:
Power   power of the dash

Definition at line 189 of file RCCommunicator.java.

Referenced by RCBrain::dribbleToGoal(), RCGoalieBrain::update(), and RCBrain::update().

void RCCommunicator::kick ( double Power,
double Direction ) [inline]
 

send a kick message to the server.

Parameters:
Power   power of the kick
Direction   direction of the kick

Definition at line 199 of file RCCommunicator.java.

Referenced by RCBrain::dribbleToGoal(), RCBrain::shoot(), and RCGoalieBrain::update().

void RCCommunicator::move ( double x,
double y ) [inline]
 

send a move message to the server.

Parameters:
x   x-coordinate
y   y-coordinate

Definition at line 218 of file RCCommunicator.java.

boolean RCCommunicator::receive ( ) [inline]
 

receive a package, and do a cycle.

If there was an error it returns false (example server closed);

Returns:
true on success else false

Definition at line 158 of file RCCommunicator.java.

Referenced by RCPlayer::run().

void RCCommunicator::say ( String Message ) [inline]
 

Send a say message to the server, with World.MsgStart as prefix.

Parameters:
Message  
Returns:
boolean

Definition at line 237 of file RCCommunicator.java.

void RCCommunicator::sence_body ( ) [inline]
 

Send a body_sence message to the server.

Definition at line 244 of file RCCommunicator.java.

void RCCommunicator::send ( String Message ) [inline]
 

This function sends a message to the server.

All other send-methods are calling this function to deliver their messages.

Parameters:
Message   message to send

Definition at line 254 of file RCCommunicator.java.

void RCCommunicator::turn ( double Movement ) [inline]
 

send a move message to the server.

Parameters:
Movement   angle of movement

Definition at line 180 of file RCCommunicator.java.

Referenced by RCBrain::dribbleToGoal(), RCGoalieBrain::update(), and RCBrain::update().

void RCCommunicator::turn_neck ( double Angle ) [inline]
 

Send a turn_neck message to the sever.

Parameters:
Angle   angle to turn

Definition at line 227 of file RCCommunicator.java.


Member Data Documentation

InetAddress RCCommunicator::Address
 

Definition at line 77 of file RCCommunicator.java.

boolean RCCommunicator::Goalie
 

Definition at line 75 of file RCCommunicator.java.

String RCCommunicator::Host
 

Attributes.

Definition at line 70 of file RCCommunicator.java.

RCParser RCCommunicator::Parser [private]
 

Associations.

Definition at line 79 of file RCCommunicator.java.

RCPlayMode RCCommunicator::PlayMode
 

Definition at line 74 of file RCCommunicator.java.

int RCCommunicator::PlayerNumber
 

Definition at line 73 of file RCCommunicator.java.

int RCCommunicator::ServerPort
 

Definition at line 71 of file RCCommunicator.java.

DatagramSocket RCCommunicator::Sock
 

Definition at line 76 of file RCCommunicator.java.

String RCCommunicator::Team
 

Definition at line 72 of file RCCommunicator.java.

RCWorld RCCommunicator::World [private]
 

Definition at line 80 of file RCCommunicator.java.


The documentation for this class was generated from the following file:
(c) Copyright by Gruppe 1 :