Split CanUse into CouldUse & IsPossible
This commit is contained in:
+10
-1
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user