// ReSharper disable MemberCanBePrivate.Global // ReSharper disable UnusedMember.Global using RGB.NET.Core; using RGB.NET.Devices.Razer.Native; namespace RGB.NET.Devices.Razer { /// /// /// Represents a razer mouse. /// public class RazerMouseRGBDevice : RazerRGBDevice, IMouse { #region Properties & Fields private readonly LedMapping _ledMapping; #endregion #region Constructors /// /// /// Initializes a new instance of the class. /// /// The specific information provided by CUE for the mouse. internal RazerMouseRGBDevice(RazerRGBDeviceInfo info, IDeviceUpdateTrigger updateTrigger, LedMapping ledMapping) : base(info, new RazerMouseUpdateQueue(updateTrigger)) { this._ledMapping = ledMapping; InitializeLayout(); } #endregion #region Methods private void InitializeLayout() { for (int row = 0; row < _Defines.MOUSE_MAX_ROW; row++) for (int column = 0; column < _Defines.MOUSE_MAX_COLUMN; column++) if (_ledMapping.TryGetValue((row * _Defines.MOUSE_MAX_COLUMN) + column, out LedId ledId)) AddLed(ledId, new Point(column * 10, row * 10), new Size(10, 10)); } /// protected override object? GetLedCustomData(LedId ledId) => _ledMapping[ledId]; #endregion } }