// ReSharper disable MemberCanBePrivate.Global
// ReSharper disable UnusedAutoPropertyAccessor.Global
// ReSharper disable UnusedMember.Global
using CUE.NET.Groups;
namespace CUE.NET.Effects
{
///
/// Represents a basic effect targeting an .
///
public abstract class AbstractLedGroupEffect : IEffect
where T : ILedGroup
{
#region Properties & Fields
///
/// Gets or sets if this effect has finished all of his work.
///
public bool IsDone { get; protected set; }
///
/// Gets the this effect is targeting.
///
protected T LedGroup { get; set; }
#endregion
#region Methods
///
/// Updates the effect.
///
/// The elapsed time (in seconds) since the last update.
public abstract void Update(float deltaTime);
///
/// Checks if the effect can be applied to the target object.
///
/// The this effect is attached to.
/// true if the effect can be attached; otherwise, false.
public virtual bool CanBeAppliedTo(ILedGroup target)
{
return target is T;
}
///
/// Hook which is called when the effect is attached to a device.
///
/// The this effect is attached to.
public virtual void OnAttach(ILedGroup target)
{
LedGroup = (T)target;
}
///
/// Hook which is called when the effect is detached from a device.
///
/// The this effect is detached from.
public virtual void OnDetach(ILedGroup target)
{
LedGroup = default(T);
}
#endregion
}
///
/// Represents a basic effect targeting an .
///
public abstract class AbstractLedGroupEffect : AbstractLedGroupEffect
{ }
}