Split CanUse into CouldUse & IsPossible

This commit is contained in:
Asriel Camora
2024-03-03 18:58:57 -08:00
parent aadde10752
commit 6f094c58ae
17 changed files with 65 additions and 30 deletions
+10 -1
View File
@@ -35,7 +35,12 @@ public class Simulator
}
public bool IsComplete => CompletionState != CompletionState.Incomplete;
public IEnumerable<ActionType> AvailableActions => ActionUtils.AvailableActions(this);
public SimulationState ExecuteUnchecked(in SimulationState state, ActionType action)
{
this.state = state;
ExecuteUnchecked(action);
return this.state;
}
public (ActionResponse Response, SimulationState NewState) Execute(in SimulationState state, ActionType action)
{
@@ -43,6 +48,10 @@ public class Simulator
return (Execute(action), this.state);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
private void ExecuteUnchecked(ActionType action) =>
action.Base().Use(this);
private ActionResponse Execute(ActionType action)
{
if (IsComplete)