using System.Collections.Generic; using RGB.NET.Core; using RGB.NET.Devices.CoolerMaster.Native; namespace RGB.NET.Devices.CoolerMaster { /// /// /// Represents the update-queue performing updates for cooler master devices. /// public class CoolerMasterUpdateQueue : UpdateQueue { #region Properties & Fields private CoolerMasterDevicesIndexes _deviceIndex; #endregion #region Constructors /// /// Initializes a new instance of the class. /// /// The update trigger used by this queue. /// The of the device this queue performs updates for. public CoolerMasterUpdateQueue(IDeviceUpdateTrigger updateTrigger, CoolerMasterDevicesIndexes deviceIndex) : base(updateTrigger) { this._deviceIndex = deviceIndex; } #endregion #region Methods /// protected override void Update(Dictionary dataSet) { foreach (KeyValuePair data in dataSet) { (int row, int column) = ((int, int))data.Key; _CoolerMasterSDK.SetLedColor(row, column, data.Value.R, data.Value.G, data.Value.B, _deviceIndex); } _CoolerMasterSDK.RefreshLed(false, _deviceIndex); } #endregion } }