SBall Class Reference
[Server Rules]

Ball for the server.

It symbolizes the ball, checks all ball manipulations. More...

#include <SBall.hh>

Inheritance diagram for SBall:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 SBall (SRules *r)
void setPosition (const Position &pos, bool advertise_client=true)
 Sets ball position and advertises the client if it changed.
void setOwner (SPlayer *p)
 Sets ball owner and advertises the client if it has changed.
void removeFromField ()
 Removes the ball from the field.
void bounce (int nb=1)
 Bounces the ball around.
void scatter (int nb)
 Scatters the ball in a random direction.
void throwIn ()
 Makes spectators throw the ball in the field.
void setThrown ()
bool hasBeenThrown ()
void resetTurn ()
void sendPosition ()

Detailed Description

Ball for the server.

It symbolizes the ball, checks all ball manipulations.

You will have only one instance of this class at runtime, handled by SRules class.


Member Function Documentation

void SBall::removeFromField (  ) 

Removes the ball from the field.

Note:
Use it before a kickoff.

void SBall::scatter ( int  nb  ) 

Scatters the ball in a random direction.

Parameters:
nb Number of squares covered.

void SBall::setPosition ( const Position pos,
bool  advertise_client = true 
)

Sets ball position and advertises the client if it changed.

Note:
Use this function instead of setPosition(pos), if you want to advertise the client in the same time.
Parameters:
pos Where to place the ball.
advertise_client Whether or not send a MSG_BALLPOS to clients.


The documentation for this class was generated from the following files:
Generated on Sat Jun 23 16:12:44 2007 for Stechec/TBT by  doxygen 1.4.7