예제 #1
0
        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);
        }
예제 #2
0
 public void AddDeviceMapping(RetroPadMapping deviceMapping)
 {
     _settings.Mappings.RemoveAll(m => m.DeviceId == deviceMapping.DeviceId && m.SubDeviceId == deviceMapping.SubDeviceId);
     _settings.Mappings.Add(deviceMapping);
 }