Implement deterministic simulation spine
This commit is contained in:
24
tests/SideScrollerGame.Sim.Tests/SimulationTestFactory.cs
Normal file
24
tests/SideScrollerGame.Sim.Tests/SimulationTestFactory.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using System.Collections.Immutable;
|
||||
using SideScrollerGame.Sim.Definitions;
|
||||
using SideScrollerGame.Sim.Input;
|
||||
using SideScrollerGame.Sim.Verification;
|
||||
|
||||
namespace SideScrollerGame.Sim.Tests;
|
||||
|
||||
internal static class SimulationTestFactory
|
||||
{
|
||||
public static GameDefinition CreateGameDefinition()
|
||||
{
|
||||
return new(ImmutableArray.Create(new PlayerDefinition(new(1), new(10, 20))));
|
||||
}
|
||||
|
||||
public static SimulationConfig CreateConfig(VerificationMode verificationMode = VerificationMode.None)
|
||||
{
|
||||
return new(SimulationDefaults.DefaultTicksPerSecond, verificationMode);
|
||||
}
|
||||
|
||||
public static TickActionBatch CreateTick(int tick, params SimulationAction[] actions)
|
||||
{
|
||||
return new(tick, ImmutableArray.Create(actions));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user