TNLTest::Building Class Reference
#include <testGame.h>
Inheritance diagram for TNLTest::Building:
Detailed Description
The
Building class is an example of a NetObject that is ScopeAlways.
ScopeAlways objects are transmitted to all clients that are currently ghosting, regardless of whether or not the scope object calls GhostConnection::objectInScope for them or not. The "buildings" are represented by red rectangles on the playing field, and are constructed with random position and extents.
Member Typedef Documentation
Member Enumeration Documentation
|
Mask bits used to determine what states are out of date for this object and what then represent.
- Enumeration values:
-
InitialMask |
Building's only mask bit is the initial mask, as no other states are ever set. |
|
Constructor & Destructor Documentation
TNLTest::Building::Building |
( |
|
) |
|
|
|
The Building constructor creates a random position and extent for the building, and marks it as scopeAlways.
|
|
The Building destructor removes the Building from the game, if it is associated with a game object.
|
Member Function Documentation
|
Called on the client when this Building object has been ghosted to the client and its first unpackUpdate has been called.
onGhostAdd adds the building to the client game.
Reimplemented from TNL::NetObject. |
void TNLTest::Building::addToGame |
( |
TestGame * |
game |
) |
|
|
|
addToGame is a helper function called by onGhostAdd and on the server to add the building to the specified game.
|
|
packUpdate is called on the server Building object to update any out-of-date network state information to the client.
Since the Building object only declares an initial mask bit state and never calls setMaskBits, this method will only be invoked when the ghost is being created on the client.
Reimplemented from TNL::NetObject. |
|
Reads the update information about the building from the specified packet BitStream.
Reimplemented from TNL::NetObject. |
TNLTest::Building::TNL_DECLARE_CLASS |
( |
Building |
|
) |
|
|
|
This macro declares Building to be a part of the TNL network class management system.
|
Field Documentation
|
The game object this building is associated with.
|
|
Upper left corner of the building rectangle on the screen.
|
|
Lower right corner of the building rectangle on the screen.
|