refactor!: Identifiable interface extracted from IEntity
This commit is contained in:
20
Engine.Core/Abstract/IHasId.cs
Normal file
20
Engine.Core/Abstract/IHasId.cs
Normal 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);
|
||||
}
|
||||
Reference in New Issue
Block a user