ForgeDocs
Documentation for the forge framework
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Pages
Forge.Networking.AutomaticTurnGame.AutomaticTurnGame Class Reference

Supports turn-based games where there are a high number of game turns per second (>5) that are automatically ended. More...

Public Member Functions

 AutomaticTurnGame (NetworkContext context, int targetUpdatesPerSecond)
 Create a new AutomaticTurnGame. More...
 
void Dispose ()
 Clean up the game from the NetworkContext. More...
 
void SendCommand (List< IGameCommand > commands)
 Send the given set of game commands to the server. It will be processed at a later point by every client. More...
 
void Update (float deltaTime)
 Update the game. Potentially dispatch game commands for execution by all computers if enough time has elapsed. More...
 
bool TryUpdate (out List< IGameCommand > commands)
 

Properties

int TargetUpdatesPerSecond [get, set]
 The number of updates we second the game should run at. More...
 
int TurnDelay [get, set]
 Configure the lag between giving input and actually receiving that input. A lower value will cause stuttering on slow networks, but user responsiveness will be higher. A higher value will cause less stuttering, but lower user responsiveness. More...
 
float InterpolationPercentage [get]
 Returns how far along we are until the next update. More...
 

Detailed Description

Supports turn-based games where there are a high number of game turns per second (>5) that are automatically ended.

Constructor & Destructor Documentation

Forge.Networking.AutomaticTurnGame.AutomaticTurnGame.AutomaticTurnGame ( NetworkContext  context,
int  targetUpdatesPerSecond 
)

Create a new AutomaticTurnGame.

Parameters
contextThe networking context.
targetUpdatesPerSecondThe number of updates/turns that will occur every second.

Member Function Documentation

void Forge.Networking.AutomaticTurnGame.AutomaticTurnGame.Dispose ( )

Clean up the game from the NetworkContext.

void Forge.Networking.AutomaticTurnGame.AutomaticTurnGame.SendCommand ( List< IGameCommand commands)

Send the given set of game commands to the server. It will be processed at a later point by every client.

Parameters
commandsThe commands to send.
void Forge.Networking.AutomaticTurnGame.AutomaticTurnGame.Update ( float  deltaTime)

Update the game. Potentially dispatch game commands for execution by all computers if enough time has elapsed.

Parameters
deltaTimeThe amount of time that has elapsed since the last call to Update.

Property Documentation

float Forge.Networking.AutomaticTurnGame.AutomaticTurnGame.InterpolationPercentage
get

Returns how far along we are until the next update.

int Forge.Networking.AutomaticTurnGame.AutomaticTurnGame.TargetUpdatesPerSecond
getset

The number of updates we second the game should run at.

int Forge.Networking.AutomaticTurnGame.AutomaticTurnGame.TurnDelay
getset

Configure the lag between giving input and actually receiving that input. A lower value will cause stuttering on slow networks, but user responsiveness will be higher. A higher value will cause less stuttering, but lower user responsiveness.


The documentation for this class was generated from the following file: