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
21 lines
633 B
C#
21 lines
633 B
C#
namespace Syntriax.Engine.Core;
|
|
|
|
/// <summary>
|
|
/// Represents a basic entity in the engine.
|
|
/// </summary>
|
|
public interface IEntity : IInitializable, IHasStateEnable
|
|
{
|
|
/// <summary>
|
|
/// Event triggered when the <see cref="Id"/> of the <see cref="IEntity"/> changes.
|
|
/// The string action parameter is the previous <see cref="Id"/> of the <see cref="IEntity"/>.
|
|
/// </summary>
|
|
Event<IEntity, IdChangedArguments> OnIdChanged { get; }
|
|
|
|
/// <summary>
|
|
/// The ID of the <see cref="IEntity"/>.
|
|
/// </summary>
|
|
string Id { get; set; }
|
|
|
|
readonly record struct IdChangedArguments(string PreviousId);
|
|
}
|