Implement ActionPool (backend only)
This commit is contained in:
+5
-3
@@ -7,6 +7,7 @@ namespace Craftimizer.Solver;
|
||||
|
||||
internal sealed class Simulator : SimulatorNoRandom
|
||||
{
|
||||
public readonly ActionPool Pool;
|
||||
private readonly int maxStepCount;
|
||||
|
||||
public override CompletionState CompletionState
|
||||
@@ -20,8 +21,9 @@ internal sealed class Simulator : SimulatorNoRandom
|
||||
}
|
||||
}
|
||||
|
||||
public Simulator(int maxStepCount)
|
||||
public Simulator(in ActionPool pool, int maxStepCount)
|
||||
{
|
||||
Pool = pool;
|
||||
this.maxStepCount = maxStepCount;
|
||||
}
|
||||
|
||||
@@ -133,9 +135,9 @@ internal sealed class Simulator : SimulatorNoRandom
|
||||
return new();
|
||||
|
||||
var ret = new ActionSet();
|
||||
foreach (var action in ActionSet.AcceptedActions)
|
||||
foreach (var action in Pool.AcceptedActions)
|
||||
if (CanUseAction(action, strict))
|
||||
ret.AddAction(action);
|
||||
ret.AddAction(in Pool, action);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user