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::GrenadeProjectile class Reference

Zap::GrenadeProjectile Class Reference

#include <projectile.h>

Inheritance diagram for Zap::GrenadeProjectile:

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

Public Types

enum  Constants {
  ExplodeMask = Item::FirstFreeMask,
  FirstFreeMask = ExplodeMask << 1
}

Public Member Functions

 GrenadeProjectile (Point pos=Point(), Point vel=Point(), U32 liveTime=0, GameObject *shooter=NULL)
bool collide (GameObject *otherObj)
void renderItem (Point p)
void idle (IdleCallPath path)
void damageObject (DamageInfo *damageInfo)
void explode (Point p)
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 (GrenadeProjectile)

Data Fields

S32 ttl
bool exploded

Private Types

typedef Item Parent

Member Typedef Documentation

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

Reimplemented from Zap::GameObject.

Reimplemented in Zap::Mine.


Member Enumeration Documentation

enum Zap::GrenadeProjectile::Constants
 

Enumeration values:
ExplodeMask 
FirstFreeMask 

Reimplemented in Zap::Mine.


Constructor & Destructor Documentation

Zap::GrenadeProjectile::GrenadeProjectile Point  pos = Point(),
Point  vel = Point(),
U32  liveTime = 0,
GameObject shooter = NULL
 


Member Function Documentation

bool Zap::GrenadeProjectile::collide GameObject otherObj  )  [inline, virtual]
 

Reimplemented from Zap::Item.

Reimplemented in Zap::Mine.

void Zap::GrenadeProjectile::renderItem Point  p  )  [virtual]
 

Implements Zap::Item.

Reimplemented in Zap::Mine.

void Zap::GrenadeProjectile::idle IdleCallPath  path  )  [virtual]
 

Reimplemented from Zap::GameObject.

Reimplemented in Zap::Mine.

void Zap::GrenadeProjectile::damageObject DamageInfo damageInfo  )  [virtual]
 

Reimplemented from Zap::GameObject.

Reimplemented in Zap::Mine.

void Zap::GrenadeProjectile::explode Point  p  ) 
 

U32 Zap::GrenadeProjectile::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.

Reimplemented in Zap::Mine.

void Zap::GrenadeProjectile::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.

Reimplemented in Zap::Mine.

Zap::GrenadeProjectile::TNL_DECLARE_CLASS GrenadeProjectile   ) 
 


Field Documentation

S32 Zap::GrenadeProjectile::ttl
 

bool Zap::GrenadeProjectile::exploded