1
0
mirror of https://github.com/DarthAffe/RGB.NET.git synced 2025-12-13 10:08:31 +00:00

68 lines
2.2 KiB
C#

// ReSharper disable UnusedMember.Global
// ReSharper disable UnusedMemberInSuper.Global
// ReSharper disable UnusedParameter.Global
namespace RGB.NET.Core
{
/// <summary>
/// Represents a basic effect.
/// </summary>
public interface IEffect
{
#region Properties & Fields
/// <summary>
/// Gets or sets if the <see cref="IEffect"/> is enabled and will be updated.
/// </summary>
bool IsEnabled { get; set; }
/// <summary>
/// Gets if this <see cref="IEffect"/> has finished all of his work.
/// </summary>
bool IsDone { get; }
#endregion
#region Methods
/// <summary>
/// Updates this <see cref="IEffect"/>.
/// </summary>
/// <param name="deltaTime">The elapsed time (in seconds) since the last update.</param>
void Update(double deltaTime);
#endregion
}
/// <summary>
/// Represents a basic effect.
/// </summary>
/// <typeparam name="T">The type of <see cref="IEffectTarget{T}"/> this effect can be attached to.</typeparam>
public interface IEffect<in T> : IEffect
where T : IEffectTarget<T>
{
#region Methods
/// <summary>
/// Checks if the <see cref="IEffect{T}"/> can be applied to the target object.
/// </summary>
/// <param name="target">The <see cref="IEffectTarget{T}"/> this effect is attached to.</param>
/// <returns><c>true</c> if the <see cref="IEffectTarget{T}"/> can be attached; otherwise, <c>false</c>.</returns>
bool CanBeAppliedTo(T target);
/// <summary>
/// Hook which is called when the <see cref="IEffect{T}"/> is attached to a <see cref="IRGBDevice"/>.
/// </summary>
/// <param name="target">The <see cref="IEffectTarget{T}"/> this effect is attached to.</param>
void OnAttach(T target);
/// <summary>
/// Hook which is called when the <see cref="IEffect{T}"/> is detached from a <see cref="IRGBDevice"/>.
/// </summary>
/// <param name="target">The <see cref="IEffectTarget{T}"/> this effect is detached from.</param>
void OnDetach(T target);
#endregion
}
}