Roses/Assets/Scripts/Domain/CustomInput.cs
2024-04-14 18:50:25 +02:00

23 lines
No EOL
602 B
C#

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