// 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)) { _ledMapping = ledMapping; InitializeLayout(); } #endregion #region Methods private void InitializeLayout() { for (int i = 0; i < _Defines.MOUSE_MAX_ROW; i++) { for (int j = 0; j < _Defines.MOUSE_MAX_COLUMN; j++) { if (_ledMapping.TryGetValue((i * _Defines.MOUSE_MAX_COLUMN) + j, out LedId ledId)) { AddLed(ledId, new Point(j * 11, i * 11), new Size(10, 10)); } } } } /// protected override object? GetLedCustomData(LedId ledId) => _ledMapping[ledId]; #endregion } }