21 lines
629 B
C#
21 lines
629 B
C#
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);
|
|
}
|