diff --git a/Simulator/Simulator.cs b/Simulator/Simulator.cs index b049eb2..849c288 100644 --- a/Simulator/Simulator.cs +++ b/Simulator/Simulator.cs @@ -73,6 +73,20 @@ public class Simulator return ActionResponse.UsedAction; } + public (ActionResponse Response, SimulationState NewState, int FailedActionIdx) ExecuteMultiple(SimulationState state, IEnumerable actions) + { + State = state; + var i = 0; + foreach(var action in actions) + { + var resp = Execute(action); + if (resp != ActionResponse.UsedAction) + return (resp, State, i); + i++; + } + return (ActionResponse.UsedAction, State, -1); + } + [Pure] [MethodImpl(MethodImplOptions.AggressiveInlining)] public int GetEffectStrength(EffectType effect) =>