private static KeyResponseModel[] CreateKeySummaryModels(string deviceId, string layerId, KeyMap keys) { return(keys.Select(x => new KeyResponseModel { Uri = $"/device/{deviceId}/layer/{layerId}/key/{x.Key}", IconUri = $"/render/layer/{layerId}/icon/{x.Key}", KeyId = x.Key, Behavior = new BehaviorResponseModel { BehaviorId = x.Value.Behavior.Type, Actions = CreateActionSummaries(x.Value.Behavior.Actions) } }).ToArray()); }
public void InitKeyMapDictionary(ControllerIndex index) { Index = index; KeyMapDictionary = new Dictionary <NesKeys, KeyMap>() { { NesKeys.a, KeyMap.A( Config.GetKeyMapConfig(index, NesKeys.a), lblA ) }, { NesKeys.b, KeyMap.B( Config.GetKeyMapConfig(index, NesKeys.b), lblB ) }, { NesKeys.select, KeyMap.Select( Config.GetKeyMapConfig(index, NesKeys.select), lblSelect ) }, { NesKeys.start, KeyMap.Start( Config.GetKeyMapConfig(index, NesKeys.start), lblStart ) }, { NesKeys.up, KeyMap.Up( Config.GetKeyMapConfig(index, NesKeys.up), lblUp ) }, { NesKeys.down, KeyMap.Down( Config.GetKeyMapConfig(index, NesKeys.down), lblDown ) }, { NesKeys.left, KeyMap.Left( Config.GetKeyMapConfig(index, NesKeys.left), lblLeft ) }, { NesKeys.right, KeyMap.Right( Config.GetKeyMapConfig(index, NesKeys.right), lblRight ) } }; }