23 lines
No EOL
602 B
C#
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();
|
|
}
|
|
} |