feat: Time

This commit is contained in:
Syntriax 2024-01-22 23:23:32 +03:00
parent 81f9ef10bf
commit 388e7f4788
2 changed files with 22 additions and 0 deletions

9
Engine.Core/GameTime.cs Normal file
View File

@ -0,0 +1,9 @@
using System;
namespace Syntriax.Engine.Core;
public record GameTime
(
TimeSpan Total,
TimeSpan Elapsed
);

13
Engine.Core/Time.cs Normal file
View File

@ -0,0 +1,13 @@
using System;
namespace Syntriax.Engine.Core;
public static class Time
{
private static GameTime _gameTime = new(TimeSpan.Zero, TimeSpan.Zero);
public static TimeSpan Total => _gameTime.Total;
public static TimeSpan Elapsed => _gameTime.Elapsed;
public static void SetTime(GameTime gameTime) => _gameTime = gameTime;
}