C# Class FootballSimulationApp.FixedTimeStepSimulationLoop

Inheritance: ISimulationLoop
Afficher le fichier Open project: PurdueSIGAI/SoccerApp

Méthodes publiques

Méthode Description
FixedTimeStepSimulationLoop ( System.TimeSpan targetElapsedTime, System.TimeSpan maxElapsedTime ) : System

After Start has been called, FixedTimeStepSimulationLoop will try to call the update function on the fixed interval specified by TargetElapsedTime. After this, if it is not time to call update again, the draw function is called. The game loop idles until the next time to call update.

SetDraw ( Action step ) : void

Sets the draw function that is called when the simulation needs to draw.

SetUpdate ( Action step ) : void

Sets the update function that is called when the simulation needs to update.

Start ( ) : void

Starts the game loop.

Tick ( ) : void

Calls update and draw when appropriate. This method should be called whenever the application does not have messages to process.

Private Methods

Méthode Description
GetElapsedTime ( ) : System.TimeSpan

Method Details

FixedTimeStepSimulationLoop() public méthode

After Start has been called, FixedTimeStepSimulationLoop will try to call the update function on the fixed interval specified by TargetElapsedTime. After this, if it is not time to call update again, the draw function is called. The game loop idles until the next time to call update.
public FixedTimeStepSimulationLoop ( System.TimeSpan targetElapsedTime, System.TimeSpan maxElapsedTime ) : System
targetElapsedTime System.TimeSpan The target time between calls to update.
maxElapsedTime System.TimeSpan The maximum amount of time between calls to draw.
Résultat System

SetDraw() public méthode

Sets the draw function that is called when the simulation needs to draw.
public SetDraw ( Action step ) : void
step Action The draw function.
Résultat void

SetUpdate() public méthode

Sets the update function that is called when the simulation needs to update.
public SetUpdate ( Action step ) : void
step Action The update function.
Résultat void

Start() public méthode

Starts the game loop.
public Start ( ) : void
Résultat void

Tick() public méthode

Calls update and draw when appropriate. This method should be called whenever the application does not have messages to process.
public Tick ( ) : void
Résultat void