20 lines
No EOL
532 B
C#
20 lines
No EOL
532 B
C#
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);
|
|
}
|
|
}
|
|
} |