public RetroPadMapping GetDeviceMapping(IMappableDevice device) { RetroPadMapping mapping = _settings.Mappings.FirstOrDefault(m => m.DeviceId == device.DeviceId && m.SubDeviceId == device.SubDeviceId); if (mapping == null) { mapping = device.DefaultMapping != null ? device.DefaultMapping : CreateNewMapping(device); } return(mapping); }
public void AddDeviceMapping(RetroPadMapping deviceMapping) { _settings.Mappings.RemoveAll(m => m.DeviceId == deviceMapping.DeviceId && m.SubDeviceId == deviceMapping.SubDeviceId); _settings.Mappings.Add(deviceMapping); }