using System.Collections;
using System.Collections.Generic;
namespace RGB.NET.Core
{
///
///
///
/// Represents a generic .
///
public abstract class AbstractLedGroup : AbstractDecoratable, ILedGroup
{
#region Properties & Fields
RGBSurface? ILedGroup.Surface { get; set; }
public RGBSurface? Surface => ((ILedGroup)this).Surface;
///
public IBrush? Brush { get; set; }
///
public int ZIndex { get; set; } = 0;
#endregion
#region Constructors
///
/// Initializes a new instance of the class.
///
protected AbstractLedGroup(RGBSurface? attachTo)
{
attachTo?.Attach(this);
}
#endregion
#region Methods
protected abstract IEnumerable GetLeds();
///
public virtual void OnAttach() { }
///
public virtual void OnDetach() { }
///
IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
///
public IEnumerator GetEnumerator() => GetLeds().GetEnumerator();
#endregion
}
}