using System; using System.Collections.Generic; using RGB.NET.Core; using RGB.NET.Core.Layout; namespace RGB.NET.Devices.Debug { /// /// /// Represents a debug device. /// public class DebugRGBDevice : AbstractRGBDevice, IUnknownDevice { #region Properties & Fields /// public override DebugRGBDeviceInfo DeviceInfo { get; } /// /// Gets the path of the layout used to mock this /// public string LayoutPath { get; } private Action> _updateLedsAction; #endregion #region Constructors /// /// Internal constructor of . /// internal DebugRGBDevice(string layoutPath, Action> updateLedsAction = null) { this.LayoutPath = layoutPath; this._updateLedsAction = updateLedsAction; DeviceLayout layout = DeviceLayout.Load(layoutPath); DeviceInfo = new DebugRGBDeviceInfo(layout.Type, layout.Vendor, layout.Model, layout.Lighting); } #endregion #region Methods internal void Initialize(string layoutPath, string imageLayout) => ApplyLayoutFromFile(layoutPath, imageLayout, true); /// protected override void UpdateLeds(IEnumerable ledsToUpdate) => _updateLedsAction?.Invoke(ledsToUpdate); #endregion } }