TPProto::Object Class Reference

The Object Frame class. More...

#include <object.h>

Inheritance diagram for TPProto::Object:

TPProto::Frame TPProto::Fleet TPProto::Galaxy TPProto::Planet TPProto::StarSystem TPProto::Universe List of all members.

Public Member Functions

 Object ()
 ~Object ()
 Required destructor.
void packBuffer (Buffer *buf)
 Asserts(0).
bool unpackBuffer (Buffer *buf)
 Unpacks the standard Object fields from the Buffer.
uint32_t getId ()
 Gets the Object's id number.
std::string getName ()
 Gets the Object's name.
std::string getDescription ()
 Gets the Object's description.
uint32_t getObjectType ()
 Gets the object type number of the object.
uint32_t getParentId ()
 Gets the Parent object's Id.
std::set< uint32_t > getContainedObjectIds ()
 Gets the set of contained objectids.
uint64_t getLastModifiedTime ()
 Gets the last time this object was modified.
void setObjectType (boost::shared_ptr< ObjectDescription > od)
 Sets the ObjectDescription this Object should use. Must be set before calling unpackBuffer.

Protected Attributes

uint32_t id
 The Object's Id.
boost::shared_ptr< ObjectDescriptionobtype
 The ObjectDescription for this object.
std::string name
 The object's name.
std::string description
uint32_t parent
std::set< uint32_t > contained
 The set of objectids that this object contains.
uint64_t modtime
 The last modification time of this object.

Detailed Description

The Object Frame class.

All Objects in the game are instances of this class. Parameters from the ObjectDescription are used to give the type of this object.


Constructor & Destructor Documentation

TPProto::Object::Object (  ) 

Constructor.


Member Function Documentation

void TPProto::Object::packBuffer ( Buffer buf  )  [virtual]

Asserts(0).

Thie method asserts zero because it should never be sent to the server. /param buf The Buffer (ignored).

Implements TPProto::Frame.

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

Unpacks the standard Object fields from the Buffer.

Everything except the ObjectType specific data is unpacked. /param buf The Buffer the Object is to be unpacked from.

Returns:
True if Successful.

Implements TPProto::Frame.

Reimplemented in TPProto::Fleet, TPProto::Planet, and TPProto::Universe.

uint32_t TPProto::Object::getId (  ) 

Gets the Object's id number.

Returns:
The id number.

std::string TPProto::Object::getName (  ) 

Gets the Object's name.

Returns:
The name of the object.

std::string TPProto::Object::getDescription (  ) 

Gets the Object's description.

Returns:
The description of the object.

uint32_t TPProto::Object::getObjectType (  ) 

Gets the object type number of the object.

Returns:
The object type number.

uint32_t TPProto::Object::getParentId (  ) 

Gets the Parent object's Id.

Returns:
The Objectid of the Parent of this object.

std::set< uint32_t > TPProto::Object::getContainedObjectIds (  ) 

Gets the set of contained objectids.

Returns:
The set of contained object ids.

uint64_t TPProto::Object::getLastModifiedTime (  ) 

Gets the last time this object was modified.

Returns:
The timestamp the object was last modified.

void TPProto::Object::setObjectType ( boost::shared_ptr< ObjectDescription od  ) 

Sets the ObjectDescription this Object should use. Must be set before calling unpackBuffer.

Parameters:
od The ObjectDescription.


Member Data Documentation

std::string TPProto::Object::description [protected]

The object's description.

uint32_t TPProto::Object::parent [protected]

The object's parent objectid.


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