All delegate events are refactored to use the Event<TSender> and Event<TSender, TArgument> for performance issues regarding delegate events creating garbage, also this gives us better control on event invocation since C# Delegates did also create unnecessary garbage during Delegate.DynamicInvoke
20 lines
502 B
C#
20 lines
502 B
C#
using Syntriax.Engine.Core;
|
|
|
|
namespace Syntriax.Engine.Systems.Time;
|
|
|
|
public interface IReadOnlyStopwatch
|
|
{
|
|
Event<IReadOnlyStopwatch> OnStarted { get; }
|
|
Event<IReadOnlyStopwatch, StopwatchDeltaArguments> OnDelta { get; }
|
|
Event<IReadOnlyStopwatch> OnStopped { get; }
|
|
|
|
double Time { get; }
|
|
|
|
TimerState State { get; }
|
|
|
|
Event<IReadOnlyStopwatch> OnPaused { get; }
|
|
Event<IReadOnlyStopwatch> OnResumed { get; }
|
|
|
|
readonly record struct StopwatchDeltaArguments(double Delta);
|
|
}
|