using System.Collections.Generic; using RGB.NET.Core; namespace RGB.NET.Devices.CoolerMaster { /// /// /// Represents a CoolerMaster mouse. /// public class CoolerMasterMouseRGBDevice : CoolerMasterRGBDevice, IMouse { #region Constructors /// /// /// Initializes a new instance of the class. /// /// The specific information provided by CoolerMaster for the mouse internal CoolerMasterMouseRGBDevice(CoolerMasterMouseRGBDeviceInfo info) : base(info) { } #endregion #region Methods /// protected override void InitializeLayout() { Dictionary mapping = CoolerMasterMouseLedMappings.Mapping[DeviceInfo.DeviceIndex]; foreach (KeyValuePair led in mapping) InitializeLed(led.Key, new Rectangle(led.Value.column * 19, led.Value.row * 19, 19, 19)); string model = DeviceInfo.Model.Replace(" ", string.Empty).ToUpper(); ApplyLayoutFromFile(PathHelper.GetAbsolutePath(this, @"Layouts\CoolerMaster\Mice", $"{model}.xml"), null); } /// protected override object CreateLedCustomData(LedId ledId) => CoolerMasterMouseLedMappings.Mapping[DeviceInfo.DeviceIndex][ledId]; #endregion } }