// ReSharper disable MemberCanBePrivate.Global using System.Collections.Generic; using System.Linq; using CUE.NET.Devices.Keyboard.Brushes; using CUE.NET.Devices.Keyboard.Keys; namespace CUE.NET.Devices.Keyboard.Effects { /// /// Represents a basic effect. /// public abstract class AbstractEffect : IEffect { #region Properties & Fields /// /// Gets or sets the list of keys to which the effect applies. /// public IEnumerable KeyList { get; protected set; } /// /// Gets the brush which is drawn by the effect. /// public abstract IBrush EffectBrush { get; } /// /// Gets or sets the z-index of the brush to allow ordering them before drawing. (lowest first) (default: 0) /// public int ZIndex { get; set; } = 0; /// /// Gets or sets if this effect has finished all of his work. /// public bool IsDone { get; protected set; } #endregion #region Methods /// /// Sets the list of keys to which the effect applies. /// /// public void SetTarget(IKeyGroup keyGroup) { KeyList = keyGroup.Keys.ToList(); } /// /// Updates the effect. /// /// The elapsed time (in seconds) since the last update. public abstract void Update(float deltaTime); /// /// Hook which is called when the effect is attached to a keyboard. /// public virtual void OnAttach() { } /// /// Hook which is called when the effect is detached from a keyboard. /// public virtual void OnDetach() { } #endregion } }