perf!: events refactored throughout all the project to use Event<> class

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
This commit is contained in:
2025-05-31 00:14:43 +03:00
parent 996e61d0ad
commit 61e2761580
58 changed files with 637 additions and 485 deletions

View File

@@ -8,7 +8,7 @@ public interface IHasUniverse : IAssignable
/// <summary>
/// Event triggered when the <see cref="IUniverse"/> value has has been assigned a new value.
/// </summary>
event UniverseAssignedEventHandler? OnUniverseAssigned;
Event<IHasUniverse> OnUniverseAssigned { get; }
/// <inheritdoc cref="IUniverse" />
IUniverse Universe { get; }
@@ -21,6 +21,4 @@ public interface IHasUniverse : IAssignable
/// <see cref="true"/>, if the value given assigned successfully assigned, <see cref="false"/> if not.
/// </returns>
bool Assign(IUniverse universe);
delegate void UniverseAssignedEventHandler(IHasUniverse sender);
}