refactor!: Identifiable interface extracted from IEntity

This commit is contained in:
2025-10-26 22:34:50 +03:00
parent 30a07dd034
commit ac2e160abb
13 changed files with 94 additions and 88 deletions

View File

@@ -0,0 +1,20 @@
namespace Engine.Core;
/// <summary>
/// Represents any instance in the engine with an id.
/// </summary>
public interface IIdentifiable
{
/// <summary>
/// Event triggered when the <see cref="Id"/> of the <see cref="IIdentifiable"/> changes.
/// The string action parameter is the previous <see cref="Id"/> of the <see cref="IIdentifiable"/>.
/// </summary>
Event<IIdentifiable, IdChangedArguments> OnIdChanged { get; }
/// <summary>
/// The ID of the <see cref="IIdentifiable"/>.
/// </summary>
string Id { get; set; }
readonly record struct IdChangedArguments(string PreviousId);
}