Compare commits
2 Commits
485dfcc51e
...
39e553ebbf
Author | SHA1 | Date | |
---|---|---|---|
39e553ebbf | |||
0ce6f8ab23 |
@@ -2,7 +2,7 @@ using System;
|
|||||||
|
|
||||||
namespace Syntriax.Engine.Core;
|
namespace Syntriax.Engine.Core;
|
||||||
|
|
||||||
public record GameTime
|
public record EngineTime
|
||||||
(
|
(
|
||||||
TimeSpan Total,
|
TimeSpan Total,
|
||||||
TimeSpan Elapsed
|
TimeSpan Elapsed
|
@@ -133,8 +133,9 @@ public class GameManager : IEntity
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Update()
|
public void Update(EngineTime time)
|
||||||
{
|
{
|
||||||
|
Time.SetTime(time);
|
||||||
foreach (var gameObject in GameObjects)
|
foreach (var gameObject in GameObjects)
|
||||||
gameObject.BehaviourController.Update();
|
gameObject.BehaviourController.Update();
|
||||||
}
|
}
|
||||||
|
@@ -4,10 +4,10 @@ namespace Syntriax.Engine.Core;
|
|||||||
|
|
||||||
public static class Time
|
public static class Time
|
||||||
{
|
{
|
||||||
private static GameTime _gameTime = new(TimeSpan.Zero, TimeSpan.Zero);
|
private static EngineTime _engineTime = new(TimeSpan.Zero, TimeSpan.Zero);
|
||||||
|
|
||||||
public static TimeSpan Total => _gameTime.Total;
|
public static TimeSpan Total => _engineTime.Total;
|
||||||
public static TimeSpan Elapsed => _gameTime.Elapsed;
|
public static TimeSpan Elapsed => _engineTime.Elapsed;
|
||||||
|
|
||||||
public static void SetTime(GameTime gameTime) => _gameTime = gameTime;
|
public static void SetTime(EngineTime engineTime) => _engineTime = engineTime;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user