feat: most sequential characters working

This commit is contained in:
Gerard Gascón 2024-04-15 00:15:39 +02:00
parent 77ee7a844e
commit 61c18429a2
20 changed files with 140 additions and 55 deletions

View file

@ -0,0 +1,20 @@
using System.Collections.Generic;
namespace Domain.Input {
public abstract class SequentialInputReader : InputReader {
protected override int Key => 0;
private readonly KeyHistory _history;
private readonly List<int> _desiredSequence;
protected SequentialInputReader(KeyHistory history, List<int> desiredSequence) {
_history = history;
_desiredSequence = desiredSequence;
}
public override void UpdateInput() {
WasPressed = IsPressed;
IsPressed = _history.ContainsSequence(_desiredSequence);
}
}
}