More moves implemented

This commit is contained in:
2025-02-01 15:00:22 +01:00
parent 3a75493912
commit 00fe08dcd4
50 changed files with 1146 additions and 139 deletions

View File

@@ -16,6 +16,7 @@ public class BattleChoiceQueue : IDeepCloneable
{
private readonly ITurnChoice?[] _choices;
private int _currentIndex;
public ITurnChoice? LastRanChoice { get; private set; }
/// <inheritdoc cref="BattleChoiceQueue"/>
public BattleChoiceQueue(ITurnChoice[] choices)
@@ -36,6 +37,7 @@ public class BattleChoiceQueue : IDeepCloneable
var choice = _choices[_currentIndex];
_choices[_currentIndex] = null;
_currentIndex++;
LastRanChoice = choice;
return choice;
}
@@ -99,4 +101,6 @@ public class BattleChoiceQueue : IDeepCloneable
}
internal IReadOnlyList<ITurnChoice?> GetChoices() => _choices;
public ITurnChoice? Where(Func<ITurnChoice, bool> predicate) => _choices.WhereNotNull().FirstOrDefault(predicate);
}