Implement ActionPool (backend only)

This commit is contained in:
Asriel Camora
2024-02-29 00:01:55 -08:00
parent 44ae3791f1
commit ecabc24517
8 changed files with 204 additions and 134 deletions
+5 -3
View File
@@ -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;
}