This commit is contained in:
2025-05-30 16:05:49 +03:00
committed by Syntriax
parent 846aa75dd5
commit b5140a94de
57 changed files with 437 additions and 462 deletions

View File

@@ -4,11 +4,11 @@ namespace Syntriax.Engine.Systems.Time;
public class StopwatchBehaviour : Behaviour, IStopwatch
{
public event IReadOnlyStopwatch.StopwatchEventHandler? OnStarted = null;
public event IReadOnlyStopwatch.StopwatchDeltaEventHandler? OnDelta = null;
public event IReadOnlyStopwatch.StopwatchEventHandler? OnStopped = null;
public event IReadOnlyStopwatch.StopwatchEventHandler? OnPaused = null;
public event IReadOnlyStopwatch.StopwatchEventHandler? OnResumed = null;
public Event<IReadOnlyStopwatch> OnStarted { get; init; } = new();
public Event<IReadOnlyStopwatch, IReadOnlyStopwatch.StopwatchDeltaArguments> OnDelta { get; init; } = new();
public Event<IReadOnlyStopwatch> OnStopped { get; init; } = new();
public Event<IReadOnlyStopwatch> OnPaused { get; init; } = new();
public Event<IReadOnlyStopwatch> OnResumed { get; init; } = new();
public double Time { get; protected set; } = 0f;
public TimerState State { get; protected set; } = TimerState.Idle;
@@ -46,7 +46,7 @@ public class StopwatchBehaviour : Behaviour, IStopwatch
double delta = Universe.Time.DeltaSpan.TotalSeconds;
Time += delta;
OnDelta?.Invoke(this, delta);
OnDelta?.Invoke(this, new(delta));
}
protected override void OnEnteredUniverse(IUniverse universe)