using System;
using System.Collections.Generic;
using RGB.NET.Core;
using RGB.NET.Layout;
namespace RGB.NET.Devices.Debug;
///
///
/// Represents a debug device.
///
public sealed class DebugRGBDevice : AbstractRGBDevice, IUnknownDevice
{
#region Properties & Fields
///
/// Gets the layour used to describe this debug device.
///
public IDeviceLayout Layout { get; }
private Action>? _updateLedsAction;
#endregion
#region Constructors
///
/// Internal constructor of .
///
internal DebugRGBDevice(IDeviceLayout layout, Action>? updateLedsAction = null)
: base(new DebugRGBDeviceInfo(layout.Type, layout.Vendor ?? "RGB.NET", layout.Model ?? "Debug", layout.CustomData), new DebugDeviceUpdateQueue())
{
this.Layout = layout;
this._updateLedsAction = updateLedsAction;
Layout.ApplyTo(this, true);
}
#endregion
#region Methods
///
protected override void UpdateLeds(IEnumerable ledsToUpdate) => _updateLedsAction?.Invoke(ledsToUpdate);
#endregion
}