// ReSharper disable MemberCanBePrivate.Global using CUE.NET.Brushes; namespace CUE.NET.Effects { /// /// Represents a basic effect targeting an . /// public abstract class AbstractBrushEffect : IEffect where T : IBrush { #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 Brush { 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(IBrush 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(IBrush target) { Brush = (T)target; } /// /// Hook which is called when the effect is detached from a device. /// /// The this effect is detached from. public virtual void OnDetach(IBrush target) { Brush = default(T); } #endregion } /// /// Represents a basic effect targeting an . /// public abstract class AbstractBrushEffect : AbstractBrushEffect { } }