feat: EngineTime.DeltaTimeFrame

This commit is contained in:
Syntriax 2024-02-01 18:43:33 +03:00
parent 1dc8f3d272
commit 5d897f2f56
2 changed files with 6 additions and 2 deletions

View File

@ -4,6 +4,8 @@ namespace Syntriax.Engine.Core;
public readonly struct EngineTime(TimeSpan Total, TimeSpan Elapsed)
{
public readonly TimeSpan Total { get; init; } = Total;
public readonly TimeSpan Elapsed { get; init; } = Elapsed;
public readonly TimeSpan Total = Total;
public readonly TimeSpan Elapsed = Elapsed;
public readonly float DeltaTimeFrame = (float)Elapsed.TotalMilliseconds;
}

View File

@ -9,5 +9,7 @@ public static class Time
public static TimeSpan Total => _engineTime.Total;
public static TimeSpan Elapsed => _engineTime.Elapsed;
public static float DeltaTimeFrame => _engineTime.DeltaTimeFrame;
public static void SetTime(EngineTime engineTime) => _engineTime = engineTime;
}