EntitiesRunner ChangeUpdateTimeStep Method Delta Engine Documentation
Changes how many times UpdateBehaviors and Updateables are called each second. By default this setting is initialized at the beginning from Settings (20 UpdatesPerSecond = 0.05). View code on GitHub

Namespace: DeltaEngine.Entities
Assembly: DeltaEngine (in DeltaEngine.dll) Version: 1.1.1.0 (1.1.1)
Syntax

public void ChangeUpdateTimeStep(
	float newUpdateTimeStep
)
Remarks

Tests: DeltaEngine.Tests.Entities.EntitiesRunnerTests
Examples

2 unit tests call DeltaEngine.Entities.EntitiesRunner.ChangeUpdateTimeStep(System.Single)
[Test]
public void TestExceptions()
{
    var settings = new MockSettings { UpdatesPerSecond = 0 };
    Assert.Throws<EntitiesRunner.InvalidUpdatePerSecondSettings>(
        () => new EntitiesRunner(new MockBehaviorResolver(), settings));
    Assert.Throws<EntitiesRunner.InvalidUpdatePerSecondSettings>(
        () => EntitiesRunner.Current.ChangeUpdateTimeStep(0));
    Assert.Throws<EntitiesRunner.YouAreNotAllowedToDrawOutsideOfTheDrawLoop>(
        () => EntitiesRunner.Current.CheckIfInDrawState());
    Assert.Throws<EntitiesRunner.UnableToResolveBehavior>(
        () => EntitiesRunner.Current.GetDrawBehavior<DrawBehavior>());
}
[Test]
public void TestUpdates()
{
    const float NewTime = 2.0f;
    EntitiesRunner.Current.ChangeUpdateTimeStep(NewTime);
    Assert.AreEqual(NewTime, Time.Delta);
}
See Also