feat: most sequential characters working
This commit is contained in:
parent
77ee7a844e
commit
61c18429a2
20 changed files with 140 additions and 55 deletions
20
Assets/Scripts/Domain/Input/SequentialInputReader.cs
Normal file
20
Assets/Scripts/Domain/Input/SequentialInputReader.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue