TPProto::Fleet Class Reference

Fleet Object. More...

#include <fleet.h>

Inheritance diagram for TPProto::Fleet:

TPProto::Object TPProto::Frame List of all members.

Public Member Functions

 Fleet ()
 Default constructor.
virtual ~Fleet ()
 Destructor.
bool unpackBuffer (Buffer *buf)
 Unpacks the Fleet Object Frame from a Buffer.
void visit (ObjectVisitor *vis)
 Visit the Fleet using an ObjectVisitor.
int getOwner ()
 Get the playerid of the owner of the fleet.
unsigned int getDamage ()
 Get the amount of damage done to the fleet.
int numShips (int stype)
 Get the number of ships of a type that are in the fleet.
std::map< int32_t, int32_t > getShips () const
 Gets a map of shiptype to number of ships.

Detailed Description

Fleet Object.


Member Function Documentation

bool TPProto::Fleet::unpackBuffer ( Buffer buf  )  [virtual]

Unpacks the Fleet Object Frame from a Buffer.

Returns:
True if successful, false otherwise.

Reimplemented from TPProto::Object.

void TPProto::Fleet::visit ( ObjectVisitor *  vis  ) 

Visit the Fleet using an ObjectVisitor.

Passes the Fleet (this) to ObjectVisitor::visit(Fleet*) method.

Parameters:
vis The ObjectVisitor that wishes to visit this Fleet.

int TPProto::Fleet::getOwner (  ) 

Get the playerid of the owner of the fleet.

Returns:
The PlayerId of the owner (-1 if no or unknown owner).

unsigned int TPProto::Fleet::getDamage (  ) 

Get the amount of damage done to the fleet.

Returns:
The amount of damage.

int TPProto::Fleet::numShips ( int  stype  ) 

Get the number of ships of a type that are in the fleet.

Parameters:
stype The type of ship.
Returns:
The number of ships of the stype type.

std::map< int32_t, int32_t > TPProto::Fleet::getShips (  )  const

Gets a map of shiptype to number of ships.

Returns:
A map of shiptype to number of ships.


The documentation for this class was generated from the following files:
Generated on Tue Jan 6 05:45:47 2009 for libtpproto-cpp by  doxygen 1.5.1