Init
This commit is contained in:
11
Prefab/Domain/Events/GenericAttributeAddedOrUpdatedEvent.cs
Normal file
11
Prefab/Domain/Events/GenericAttributeAddedOrUpdatedEvent.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
using Prefab.Domain.Common;
|
||||
|
||||
namespace Prefab.Domain.Events;
|
||||
|
||||
/// <summary>
|
||||
/// Event raised when a generic attribute is added or updated on an entity.
|
||||
/// </summary>
|
||||
/// <param name="Entity">The entity that owns the attribute.</param>
|
||||
/// <param name="Key">The attribute key.</param>
|
||||
/// <param name="Value">The new attribute value.</param>
|
||||
public record GenericAttributeAddedOrUpdatedEvent(object Entity, string Key, object Value) : Event;
|
||||
25
Prefab/Domain/Events/GenericAttributeChangedEvent.cs
Normal file
25
Prefab/Domain/Events/GenericAttributeChangedEvent.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using Prefab.Domain.Common;
|
||||
|
||||
namespace Prefab.Domain.Events;
|
||||
|
||||
/// <summary>
|
||||
/// Event raised whenever a generic attribute is added, updated, or removed from an entity.
|
||||
/// </summary>
|
||||
/// <param name="Entity">The entity that owns the attribute.</param>
|
||||
/// <param name="Key">The attribute key.</param>
|
||||
/// <param name="Value">The attribute value involved in the change.</param>
|
||||
/// <param name="ChangeType">Indicates the type of mutation performed.</param>
|
||||
public record GenericAttributeChangedEvent(object Entity, string Key, object? Value, GenericAttributeChangeType ChangeType) : Event;
|
||||
|
||||
/// <summary>
|
||||
/// Represents the types of mutations that can occur for a generic attribute.
|
||||
/// </summary>
|
||||
public enum GenericAttributeChangeType
|
||||
{
|
||||
/// <summary>Attribute was added for the first time.</summary>
|
||||
Add,
|
||||
/// <summary>Attribute was updated with a new value.</summary>
|
||||
Update,
|
||||
/// <summary>Attribute was removed.</summary>
|
||||
Remove
|
||||
}
|
||||
10
Prefab/Domain/Events/GenericAttributeRemovedEvent.cs
Normal file
10
Prefab/Domain/Events/GenericAttributeRemovedEvent.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
using Prefab.Domain.Common;
|
||||
|
||||
namespace Prefab.Domain.Events;
|
||||
|
||||
/// <summary>
|
||||
/// Event raised when a generic attribute is removed from an entity.
|
||||
/// </summary>
|
||||
/// <param name="Entity">The entity that owned the attribute.</param>
|
||||
/// <param name="Key">The key that was removed.</param>
|
||||
public record GenericAttributeRemovedEvent(object Entity, string Key) : Event;
|
||||
Reference in New Issue
Block a user