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

# Zap::Game Class Reference

`#include <game.h>`

Inheritance diagram for Zap::Game:

## Detailed Description

Base class for server and client Game subclasses.

The Game base class manages all the objects in the game simulation on either the server or the client, and is responsible for managing the passage of time as well as rendering.

## Public Types

enum | { DefaultGridSize = 256, PlayerHorizVisDistance = 600, PlayerVertVisDistance = 450, PlayerScopeMargin = 150,
PlayerSensorHorizVisDistance = 1060,
PlayerSensorVertVisDistance = 795,
MasterServerConnectAttemptDelay = 60000
}

## Public Member Functions

| Game (const Address &theBindAddress)
virtual | ~Game ()
Rect | computeWorldObjectExtents ()
void | addToDeleteList (GameObject *theObject, U32 delay)
void | addToGameObjectList (GameObject *theObject)
void | removeFromGameObjectList (GameObject *theObject)
void | deleteObjects (U32 typeMask)
void | setGridSize (F32 gridSize)
F32 | getGridSize ()
U32 | getCurrentTime ()
virtual bool | isServer ()=0
virtual void | idle (U32 timeDelta)=0
void | checkConnectionToMaster (U32 timeDelta)
MasterServerConnection * | getConnectionToMaster ()
GameNetInterface * | getNetInterface ()
GridDatabase * | getGridDatabase ()
const Vector< SafePtr< GameObject > > & | getScopeAlwaysList ()
void | setScopeAlwaysObject (GameObject *theObject)
GameType * | getGameType ()
U32 | getTeamCount ()
void | setGameType (GameType *theGameType)
void | processDeleteList (U32 timeDelta)

## Protected Attributes

U32 | mNextMasterTryTime
F32 | mGridSize
GridDatabase | mDatabase
Vector< GameObject * > | mGameObjects
Vector< DeleteRef > | mPendingDeleteObjects
Vector< SafePtr< GameObject > > | mScopeAlwaysList
U32 | mCurrentTime
RefPtr< GameNetInterface > | mNetInterface
SafePtr< MasterServerConnection > | mConnectionToMaster
SafePtr< GameType > | mGameType

## Data Structures

struct | DeleteRef

## Member Enumeration Documentation

anonymous enum

Enumerator:

  DefaultGridSize |
  PlayerHorizVisDistance |
  PlayerVertVisDistance |
  PlayerScopeMargin |
  PlayerSensorHorizVisDistance |
  PlayerSensorVertVisDistance |
  MasterServerConnectAttemptDelay |

## Constructor & Destructor Documentation

Zap::Game::Game | ( | const Address & | theBindAddress | ) |

virtual Zap::Game::~Game | ( |  | ) | `[inline, virtual]`

## Member Function Documentation

Rect Zap::Game::computeWorldObjectExtents | ( |  | ) |

void Zap::Game::addToDeleteList | ( | GameObject * | theObject,
|  | U32 | delay |
| ) |  |  |

void Zap::Game::addToGameObjectList | ( | GameObject * | theObject | ) |

void Zap::Game::removeFromGameObjectList | ( | GameObject * | theObject | ) |

void Zap::Game::deleteObjects | ( | U32 | typeMask | ) |

void Zap::Game::setGridSize | ( | F32 | gridSize | ) | `[inline]`

F32 Zap::Game::getGridSize | ( |  | ) | `[inline]`

U32 Zap::Game::getCurrentTime | ( |  | ) | `[inline]`

virtual bool Zap::Game::isServer | ( |  | ) | `[pure virtual]`

Implemented in Zap::ServerGame, and Zap::ClientGame.

virtual void Zap::Game::idle | ( | U32 | timeDelta | ) | `[pure virtual]`

Implemented in Zap::ServerGame, and Zap::ClientGame.

void Zap::Game::checkConnectionToMaster | ( | U32 | timeDelta | ) |

MasterServerConnection* Zap::Game::getConnectionToMaster | ( |  | ) |

GameNetInterface* Zap::Game::getNetInterface | ( |  | ) |

GridDatabase* Zap::Game::getGridDatabase | ( |  | ) | `[inline]`

const Vector<SafePtr<GameObject> >& Zap::Game::getScopeAlwaysList | ( |  | ) | `[inline]`

void Zap::Game::setScopeAlwaysObject | ( | GameObject * | theObject | ) |

GameType* Zap::Game::getGameType | ( |  | ) |

U32 Zap::Game::getTeamCount | ( |  | ) |

void Zap::Game::setGameType | ( | GameType * | theGameType | ) |

void Zap::Game::processDeleteList | ( | U32 | timeDelta | ) |

## Field Documentation

U32 Zap::Game::mNextMasterTryTime`[protected]`

F32 Zap::Game::mGridSize`[protected]`

GridDatabase Zap::Game::mDatabase`[protected]`

Vector<GameObject *> Zap::Game::mGameObjects`[protected]`

Vector<DeleteRef> Zap::Game::mPendingDeleteObjects`[protected]`

Vector<SafePtr<GameObject> > Zap::Game::mScopeAlwaysList`[protected]`

U32 Zap::Game::mCurrentTime`[protected]`

RefPtr<GameNetInterface> Zap::Game::mNetInterface`[protected]`

SafePtr<MasterServerConnection> Zap::Game::mConnectionToMaster`[protected]`

SafePtr<GameType> Zap::Game::mGameType`[protected]`