Add randomSeed parameter to BattleImpl, fix flaky test
This commit is contained in:
@@ -123,7 +123,7 @@ public class BattleImpl : ScriptSource, IBattle
|
||||
{
|
||||
/// <inheritdoc cref="BattleImpl"/>
|
||||
public BattleImpl(IDynamicLibrary library, IReadOnlyList<IBattleParty> parties, bool canFlee, byte numberOfSides,
|
||||
byte positionsPerSide)
|
||||
byte positionsPerSide, int? randomSeed = null)
|
||||
{
|
||||
Library = library;
|
||||
Parties = parties;
|
||||
@@ -134,7 +134,7 @@ public class BattleImpl : ScriptSource, IBattle
|
||||
for (byte i = 0; i < numberOfSides; i++)
|
||||
sides[i] = new BattleSideImpl(i, positionsPerSide, this);
|
||||
Sides = sides;
|
||||
Random = new BattleRandomImpl();
|
||||
Random = randomSeed.HasValue ? new BattleRandomImpl(randomSeed.Value) : new BattleRandomImpl();
|
||||
EventHook = new EventHook();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user