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.EntitiesAssembly: DeltaEngine (in DeltaEngine.dll) Version: 1.1.1.0 (1.1.1)
public void ChangeUpdateTimeStep(
float newUpdateTimeStep
)
public void ChangeUpdateTimeStep(
float newUpdateTimeStep
)
Public Sub ChangeUpdateTimeStep (
newUpdateTimeStep As Single
)
Public Sub ChangeUpdateTimeStep (
newUpdateTimeStep As Single
)
public:
void ChangeUpdateTimeStep(
float newUpdateTimeStep
)
public:
void ChangeUpdateTimeStep(
float newUpdateTimeStep
)
member ChangeUpdateTimeStep :
newUpdateTimeStep : float32 -> unit
member ChangeUpdateTimeStep :
newUpdateTimeStep : float32 -> unit
Tests:
DeltaEngine.Tests.Entities.EntitiesRunnerTests2 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 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);
}
[Test]
public void TestUpdates()
{
const float NewTime = 2.0f;
EntitiesRunner.Current.ChangeUpdateTimeStep(NewTime);
Assert.AreEqual(NewTime, Time.Delta);
}