TNLTest::TestGame Class Reference
#include <testGame.h>
Detailed Description
The
TestGame class manages a
TNLTest client or server instance.
TestGame maintains a list of all the Player and Building objects in the playing area, and interfaces with the specific platform's windowing system to respond to user input and render the current game display.
Constructor & Destructor Documentation
|
Constructor for TestGame, determines whether this game will be a client or a server, and what addresses to bind to and ping.
If this game is a server, it will construct 50 random buildings and 15 random AI players to populate the "world" with. TestGame also constructs an AsymmetricKey to demonstrate establishing secure connections with clients and servers. |
|
Destroys a game, freeing all Player and Building objects associated with it.
|
Member Function Documentation
void TNLTest::TestGame::createLocalConnection |
( |
TestGame * |
serverGame |
) |
|
|
|
createLocalConnection demonstrates the use of so-called "short circuit" connections for connecting to a server NetInterface in the same process as this client game.
|
void TNLTest::TestGame::tick |
( |
|
) |
|
|
|
Called periodically by the platform windowing code, tick will update all the players in the simulation as well as tick() the game's network interface.
|
void TNLTest::TestGame::renderFrame |
( |
int |
width, |
|
|
int |
height |
|
) |
|
|
|
renderFrame is called by the platform windowing code to notify the game that it should render the current world using the specified window area.
|
void TNLTest::TestGame::moveMyPlayerTo |
( |
Position |
newPosition |
) |
|
|
|
moveMyPlayerTo is called by the platform windowing code in response to user input.
|
Field Documentation
|
vector of player objects in the game
|
|
vector of buildings in the game
|
|
was this game created to be a server?
|
|
network interface for this game
|
|
last time that tick() was called
|
|
the player that the server controls
|
|
the player that this client controls, if this game is a client
|