Main Page Modules Namespaces C++ Classes Compound List File List Index
TNL: Zap::Item Class Reference

# Zap::Item Class Reference

`#include <item.h>`

Inheritance diagram for Zap::Item:

## Public Member Functions

void | idle (GameObject::IdleCallPath path)
void | processArguments (S32 argc, const char **argv)
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().
| Item (Point p=Point(0, 0), bool collideable=false, float radius=1, float mass=1)
void | setActualPos (Point p)
void | setActualVel (Point vel)
void | mountToShip (Ship *theShip)
bool | isMounted ()
void | setZone (GoalZone *theZone)
GoalZone * | getZone ()
Ship * | getMount ()
void | dismount ()
void | render ()
virtual void | renderItem (Point pos)=0
virtual void | onMountDestroyed ()
bool | collide (GameObject *otherObject)

## Protected Types

enum | MaskBits { InitialMask = BIT(0), PositionMask = BIT(1), WarpPositionMask = BIT(2), MountMask = BIT(3),
ZoneMask = BIT(4),
FirstFreeMask = BIT(5)
}

## Protected Attributes

SafePtr< Ship > | mMount
SafePtr< GoalZone > | mZone
bool | mIsMounted
bool | mIsCollideable

## Member Enumeration Documentation

enum Zap::Item::MaskBits`[protected]`

Enumerator:

  InitialMask |
  PositionMask |
  WarpPositionMask |
  MountMask |
  ZoneMask |
  FirstFreeMask |

Reimplemented in Zap::HuntersFlagItem, and Zap::PickupItem.

## Constructor & Destructor Documentation

Zap::Item::Item | ( | Point | p = `Point(0, 0)`,
|  | bool | collideable = `false`,
|  | float | radius = `1`,
|  | float | mass = `1` |
| ) |  |  |

## Member Function Documentation

void Zap::Item::idle | ( | GameObject::IdleCallPath | path | ) | `[virtual]`

Reimplemented from Zap::GameObject.

Reimplemented in Zap::PickupItem, Zap::GrenadeProjectile, Zap::Mine, and Zap::SoccerBallItem.

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

Reimplemented from Zap::GameObject.

Reimplemented in Zap::FlagItem, and Zap::SoccerBallItem.

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

Reimplemented in Zap::FlagItem, Zap::HuntersFlagItem, Zap::PickupItem, Zap::GrenadeProjectile, and Zap::Mine.

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

Reimplemented in Zap::FlagItem, Zap::HuntersFlagItem, Zap::PickupItem, Zap::GrenadeProjectile, and Zap::Mine.

void Zap::Item::setActualPos | ( | Point | p | ) | `[virtual]`

Reimplemented from Zap::GameObject.

void Zap::Item::setActualVel | ( | Point | vel | ) |

Reimplemented in Zap::HuntersFlagItem.

void Zap::Item::mountToShip | ( | Ship * | theShip | ) |

bool Zap::Item::isMounted | ( |  | ) | `[inline]`

void Zap::Item::setZone | ( | GoalZone * | theZone | ) |

GoalZone* Zap::Item::getZone | ( |  | ) |

Ship* Zap::Item::getMount | ( |  | ) |

void Zap::Item::dismount | ( |  | ) |

void Zap::Item::render | ( |  | ) | `[virtual]`

Reimplemented from Zap::GameObject.

virtual void Zap::Item::renderItem | ( | Point | pos | ) | `[pure virtual]`

Implemented in Zap::FlagItem, Zap::HuntersFlagItem, Zap::GrenadeProjectile, Zap::Mine, and Zap::SoccerBallItem.

virtual void Zap::Item::onMountDestroyed | ( |  | ) | `[virtual]`

Reimplemented in Zap::FlagItem, and Zap::HuntersFlagItem.

bool Zap::Item::collide | ( | GameObject * | otherObject | ) | `[virtual]`

Reimplemented from Zap::MoveObject.

Reimplemented in Zap::FlagItem, Zap::HuntersFlagItem, Zap::PickupItem, Zap::GrenadeProjectile, Zap::Mine, and Zap::SoccerBallItem.

## Field Documentation

SafePtr<Ship> Zap::Item::mMount`[protected]`

SafePtr<GoalZone> Zap::Item::mZone`[protected]`

bool Zap::Item::mIsMounted`[protected]`

bool Zap::Item::mIsCollideable`[protected]`