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

Zap::PickupItem Class Reference

#include <item.h>

Inheritance diagram for Zap::PickupItem:

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

Public Member Functions

 PickupItem (Point p=Point(), float radius=1)
void idle (GameObject::IdleCallPath path)
bool isVisible ()
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().

bool collide (GameObject *otherObject)
virtual bool pickup (Ship *theShip)=0
virtual U32 getRepopDelay ()=0
virtual void onClientPickup ()=0

Protected Types

enum  MaskBits {
  PickupMask = Parent::FirstFreeMask << 0,
  FirstFreeMask = Parent::FirstFreeMask << 1
}

Private Types

typedef Item Parent

Private Attributes

bool mIsVisible
Timer mRepopTimer

Member Typedef Documentation

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

Reimplemented from Zap::GameObject.


Member Enumeration Documentation

enum Zap::PickupItem::MaskBits [protected]
 

Enumeration values:
PickupMask 
FirstFreeMask 

Reimplemented from Zap::Item.


Constructor & Destructor Documentation

Zap::PickupItem::PickupItem Point  p = Point(),
float  radius = 1
 


Member Function Documentation

void Zap::PickupItem::idle GameObject::IdleCallPath  path  ) 
 

Reimplemented from Zap::Item.

bool Zap::PickupItem::isVisible  )  [inline]
 

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

bool Zap::PickupItem::collide GameObject otherObject  )  [virtual]
 

Reimplemented from Zap::Item.

virtual bool Zap::PickupItem::pickup Ship theShip  )  [pure virtual]
 

virtual U32 Zap::PickupItem::getRepopDelay  )  [pure virtual]
 

virtual void Zap::PickupItem::onClientPickup  )  [pure virtual]
 


Field Documentation

bool Zap::PickupItem::mIsVisible [private]
 

Timer Zap::PickupItem::mRepopTimer [private]