using System; using System.Collections.Generic; namespace DS4Windows { public class ControllerSlotManager { private List controllerColl; public List ControllerColl { get => controllerColl; set => controllerColl = value; } private Dictionary controllerDict; private Dictionary reverseControllerDict; public Dictionary ControllerDict { get => controllerDict; } public Dictionary ReverseControllerDict { get => reverseControllerDict; } public ControllerSlotManager() { controllerColl = new List(); controllerDict = new Dictionary(); reverseControllerDict = new Dictionary(); } public void AddController(DS4Device device, int slotIdx) { controllerColl.Add(device); controllerDict.Add(slotIdx, device); reverseControllerDict.Add(device, slotIdx); } public void RemoveController(DS4Device device, int slotIdx) { controllerColl.Remove(device); controllerDict.Remove(slotIdx); reverseControllerDict.Remove(device); } public void ClearControllerList() { controllerColl.Clear(); controllerDict.Clear(); reverseControllerDict.Clear(); } } }