using System; using System.Collections.Generic; using Domain.Input; namespace Domain { public class CustomInput { private readonly Dictionary _readers = new(); private readonly KeyHistory _history; public CustomInput() { _history = new KeyHistory(); _readers.Add(typeof(CedillaReader), new CedillaReader()); _readers.Add(typeof(GeminadaReader), new GeminadaReader(_history)); } public void UpdateInput() { _history.CheckPresses(); foreach (KeyValuePair reader in _readers) { reader.Value.UpdateInput(); } } public bool KeyDown(Type key) => _readers[key].KeyDown(); } }