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

Zap::Teleporter Class Reference

#include <teleporter.h>

Inheritance diagram for Zap::Teleporter:

Zap::GameObject TNL::NetObject TNL::Object

Public Types

enum  {
  InitMask = BIT(0),
  TeleportMask = BIT(1),
  TeleporterRadius = 75,
  TeleporterTriggerRadius = 50,
  TeleporterDelay = 1500,
  TeleporterExpandTime = 1350,
  TeleportInExpandTime = 750,
  TeleportInRadius = 120
}

Public Member Functions

 Teleporter (Point center=Point(), Point exit=Point())
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().

void idle (GameObject::IdleCallPath path)
void render ()
void onAddedToGame (Game *theGame)
void processArguments (S32 argc, const char **argv)
 TNL_DECLARE_CLASS (Teleporter)

Data Fields

Point pos
Point dest
bool doSplash
U32 timeout
U32 mTime

Member Enumeration Documentation

anonymous enum
 

Enumeration values:
InitMask 
TeleportMask 
TeleporterRadius 
TeleporterTriggerRadius 
TeleporterDelay 
TeleporterExpandTime 
TeleportInExpandTime 
TeleportInRadius 


Constructor & Destructor Documentation

Zap::Teleporter::Teleporter Point  center = Point(),
Point  exit = Point()
 


Member Function Documentation

U32 Zap::Teleporter::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 TNL::NetObject.

void Zap::Teleporter::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 TNL::NetObject.

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

void Zap::Teleporter::render  )  [virtual]
 

Reimplemented from Zap::GameObject.

void Zap::Teleporter::onAddedToGame Game theGame  )  [virtual]
 

Reimplemented from Zap::GameObject.

void Zap::Teleporter::processArguments S32  argc,
const char **  argv
[virtual]
 

Reimplemented from Zap::GameObject.

Zap::Teleporter::TNL_DECLARE_CLASS Teleporter   ) 
 


Field Documentation

Point Zap::Teleporter::pos
 

Point Zap::Teleporter::dest
 

bool Zap::Teleporter::doSplash
 

U32 Zap::Teleporter::timeout
 

U32 Zap::Teleporter::mTime