2025-05-30 18:37:35 +03:00

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);
}