#include <testGame.h>
Inheritance diagram for TNLTest::Building:
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.
Public Types | |
enum | MaskBits { InitialMask = (1 << 0) } |
Mask bits used to determine what states are out of date for this object and what then represent. More... | |
Public Member Functions | |
Building () | |
The Building constructor creates a random position and extent for the building, and marks it as scopeAlways. | |
~Building () | |
The Building destructor removes the Building from the game, if it is associated with a game object. | |
bool | onGhostAdd (TNL::GhostConnection *theConnection) |
Called on the client when this Building object has been ghosted to the client and its first unpackUpdate has been called. | |
void | addToGame (TestGame *game) |
addToGame is a helper function called by onGhostAdd and on the server to add the building to the specified game. | |
TNL::U32 | packUpdate (TNL::GhostConnection *connection, TNL::U32 updateMask, TNL::BitStream *stream) |
packUpdate is called on the server Building object to update any out-of-date network state information to the client. | |
void | unpackUpdate (TNL::GhostConnection *connection, TNL::BitStream *stream) |
Reads the update information about the building from the specified packet BitStream. | |
TNL_DECLARE_CLASS (Building) | |
This macro declares Building to be a part of the TNL network class management system. | |
Data Fields | |
TestGame * | game |
The game object this building is associated with. | |
Position | upperLeft |
Upper left corner of the building rectangle on the screen. | |
Position | lowerRight |
Lower right corner of the building rectangle on the screen. | |
Private Types | |
typedef TNL::NetObject | Parent |
|
Reimplemented from TNL::NetObject. |
|
Mask bits used to determine what states are out of date for this object and what then represent.
|
|
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.
|
|
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. |
|
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. |
|
This macro declares Building to be a part of the TNL network class management system.
|
|
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.
|