20 lines
552 B
C#

namespace Engine.Core;
/// <summary>
/// Represents an entity which can be active or not.
/// </summary>
public interface IActive
{
/// <summary>
/// Event triggered when the <see cref="IsActive"/> state of the <see cref="IActive"/> changes.
/// </summary>
Event<IActive, ActiveChangedArguments> OnActiveChanged { get; }
/// <summary>
/// The value indicating whether the <see cref="IActive"/> is enabled.
/// </summary>
bool IsActive { get; }
readonly record struct ActiveChangedArguments(bool PreviousState);
}