News SF.net Project Frequently Asked Questions Documentation Downloads Mailing Lists How to Contribute

SourceForge.net Logo

Changing the way games are made and played.

Zap::FlagItem class Reference

Zap::FlagItem Class Reference

#include <flagItem.h>

Inheritance diagram for Zap::FlagItem:

Zap::Item Zap::MoveObject Zap::GameObject TNL::NetObject TNL::Object

Public Member Functions

 FlagItem (Point pos=Point())
void onAddedToGame (Game *theGame)
void processArguments (S32 argc, const char **argv)
void renderItem (Point pos)
void sendHome ()
void onMountDestroyed ()
bool collide (GameObject *hitObject)
bool isAtHome ()
U32 packUpdate (GhostConnection *connection, U32 updateMask, BitStream *stream)
 Write the object's state to a packet.

void unpackUpdate (GhostConnection *connection, BitStream *stream)
 Unpack data written by packUpdate().

 TNL_DECLARE_CLASS (FlagItem)

Private Types

typedef Item Parent

Private Attributes

Point initialPos

Member Typedef Documentation

typedef Item Zap::FlagItem::Parent [private]
 

Reimplemented from Zap::GameObject.


Constructor & Destructor Documentation

Zap::FlagItem::FlagItem (  Point  pos = Point()  ) 
 


Member Function Documentation

void Zap::FlagItem::onAddedToGame (  Game *  theGame  )  [virtual]
 

Reimplemented from Zap::GameObject.

void Zap::FlagItem::processArguments (  S32  argc,
const char **  argv
)  [virtual]
 

Reimplemented from Zap::Item.

void Zap::FlagItem::renderItem (  Point  pos  )  [virtual]
 

Implements Zap::Item.

void Zap::FlagItem::sendHome (   ) 
 

void Zap::FlagItem::onMountDestroyed (   )  [virtual]
 

Reimplemented from Zap::Item.

bool Zap::FlagItem::collide (  GameObject *  hitObject  )  [virtual]
 

Reimplemented from Zap::Item.

bool Zap::FlagItem::isAtHome (   ) 
 

U32 Zap::FlagItem::packUpdate (  GhostConnection *  connection,
U32  updateMask,
BitStream *  stream
)  [virtual]
 

Write the object's state to a packet.

packUpdate is called on an object when it is to be written into a packet stream for transmission to the client. The updateMask parameter contains the out-of-date state mask for the object. The initial update mask for any object to a client will always be 0xFFFFFFFF, signifying that all states are out of date. It is often useful to check for this mask, to write one-time initialization information for that object.

Reimplemented from Zap::Item.

void Zap::FlagItem::unpackUpdate (  GhostConnection *  connection,
BitStream *  stream
)  [virtual]
 

Unpack data written by packUpdate().

unpackUpdate is called on the client to read an update out of a packet's bit stream. Because the update mask is not encoded by the network system directly, each unpack update function will have to determine from the bit stream which states are being updated.

Reimplemented from Zap::Item.

Zap::FlagItem::TNL_DECLARE_CLASS (  FlagItem   ) 
 


Field Documentation

Point Zap::FlagItem::initialPos [private]