#include <client.h>
Inheritance diagram for Client:
Public Methods | |
Client (ost::TCPSocket &sock, World *w) | |
~Client () | |
void | sendMessage (const Message &msg) |
virtual void | Run (void) |
void | initialize () |
string | getName () |
Protected Methods | |
Functions | |
The functions that the protocol may need | |
void | newCylinder (Message &msg) |
void | grow (Message &msg) |
void | sendEnergy (Message &msg) |
void | move (Message &msg) |
void | dropCylinder (Message &msg) |
void | sendMessage (Message &msg) |
void | clientLog (Message &msg) |
void | endOfTurn (Message &msg) |
Protected Attributes | |
string | name |
|
Definition at line 39 of file client.cc. References initialize(). |
|
Definition at line 35 of file client.cc. References World::clientOut(), and baseClient::world. |
|
Log a message Definition at line 372 of file client.cc. References log, Message::msg, Message::petition, Message::sendTo(), Message::size, and baseClient::stream. Referenced by Run(). |
|
Make a cylinder get droped from agent, includes the creation message of the new agent son Definition at line 164 of file client.cc. References World::getAgent(), Cylinder::getFather(), log, Message::msg, Cylinder::newIntention(), Message::organismId, Message::petition, Message::sendTo(), Message::size, baseClient::stream, Message::umsg, and baseClient::world. Referenced by Run(). |
|
Definition at line 386 of file client.cc. References baseClient::dontWalk(), Message::petition, Message::sendTo(), and baseClient::stream. Referenced by Run(). |
|
Definition at line 57 of file client.h. References name. Referenced by World::newAgent(), and CommCenter::newClient(). |
|
Make the client grow a little bit Definition at line 274 of file client.cc. References World::getAgent(), Cylinder::getEnergy(), growHorizontal, GrowType, growVertical, log, Cylinder::newIntention(), Message::organismId, Message::petition, Message::sendTo(), Message::size, baseClient::stream, Message::umsg, and baseClient::world. Referenced by Run(). |
|
Definition at line 89 of file client.cc. References baseClient::alive, log, name, World::newAgent(), Point3d, baseClient::stream, and baseClient::world. Referenced by Client(). |
|
Moves a cylinder, around it's father Definition at line 316 of file client.cc. References World::getAgent(), Cylinder::getEnergy(), log, moveHorizontalCCW, moveHorizontalCW, MoveType, moveUnknown, moveVerticalCCW, moveVerticalCW, Message::msg, Cylinder::newIntention(), Message::organismId, Message::petition, Message::sendTo(), Message::size, baseClient::stream, Message::umsg, and baseClient::world. Referenced by Run(). |
|
Make a cylinder appear near any other cylinder Definition at line 119 of file client.cc. References World::getAgent(), Agent::getCylinderCount(), Cylinder::getEnergy(), log, M_PI, Message::msg, Cylinder::newIntention(), Message::organismId, Message::petition, Message::sendTo(), Message::size, baseClient::stream, Message::umsg, and baseClient::world. Referenced by Run(). |
|
Runs the wait-for-messages loop Reimplemented from baseClient. Definition at line 43 of file client.cc. References baseClient::alive, clientLog(), dropCylinder(), endOfTurn(), grow(), log, messageDrop, messageEndOfTurn, messageGrow, messageLog, messageMove, messageNewCylinder, messageSendEnergy, messageSendMessage, move(), newCylinder(), sendEnergy(), sendMessage(), baseClient::stream, and Message::type. |
|
Send some energy from a parent cylinder to one of his sons, or from son to his father Definition at line 230 of file client.cc. References Cylinder::dist(), World::getAgent(), Cylinder::getEnergy(), log, Cylinder::newIntention(), Message::organismId, Message::petition, Message::sendTo(), Message::size, baseClient::stream, Message::umsg, and baseClient::world. Referenced by Run(). |
|
Definition at line 53 of file client.h. References baseClient::stream. |
|
Send a message to another agent, and maybe some clients can get it from the air. This message is sent by cylinder n. zero, always. Definition at line 201 of file client.cc. References World::getAgent(), log, Message::msg, Cylinder::newIntention(), Message::organismId, Message::petition, Message::sendTo(), Message::size, baseClient::stream, Message::umsg, and baseClient::world. Referenced by Agent::Agent(), and Run(). |
|
The name and version of the client Definition at line 32 of file client.h. Referenced by getName(), and initialize(). |