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