C# Класс FootballSimulationApp.FixedTimeStepSimulationLoop

Наследование: ISimulationLoop
Показать файл Открыть проект

Открытые методы

Метод Описание
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.

Приватные методы

Метод Описание
GetElapsedTime ( ) : System.TimeSpan

Описание методов

FixedTimeStepSimulationLoop() публичный Метод

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.
Результат System

SetDraw() публичный Метод

Sets the draw function that is called when the simulation needs to draw.
public SetDraw ( Action step ) : void
step Action The draw function.
Результат void

SetUpdate() публичный Метод

Sets the update function that is called when the simulation needs to update.
public SetUpdate ( Action step ) : void
step Action The update function.
Результат void

Start() публичный Метод

Starts the game loop.
public Start ( ) : void
Результат void

Tick() публичный Метод

Calls update and draw when appropriate. This method should be called whenever the application does not have messages to process.
public Tick ( ) : void
Результат void