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

20 lines
614 B
C#

namespace Syntriax.Engine.Core;
/// <summary>
/// Represents an entity with an enable state that can be toggled.
/// </summary>
public interface IStateEnable : IHasEntity
{
/// <summary>
/// Event triggered when the <see cref="Enabled"/> state of the <see cref="IStateEnable"/> changes.
/// </summary>
Event<IStateEnable, EnabledChangedArguments> OnEnabledChanged { get; }
/// <summary>
/// The value indicating whether the <see cref="IStateEnable"/> is enabled.
/// </summary>
bool Enabled { get; set; }
readonly record struct EnabledChangedArguments(bool PreviousState);
}