Стабилизировать посадку бота на платформу уровня 8
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
package com.projectsacrifice.game;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
public final class MovingPlatformLaunchPolicyTest {
|
||||
@Test
|
||||
public void launchRequiresStablePoweredSupportInTheLaunchZone() {
|
||||
assertFalse(MovingPlatformLaunchPolicy.ready(snapshot(910f, true, true, true), 1_150f));
|
||||
assertFalse(MovingPlatformLaunchPolicy.ready(snapshot(1_150f, false, true, true), 1_150f));
|
||||
assertFalse(MovingPlatformLaunchPolicy.ready(snapshot(1_150f, true, false, true), 1_150f));
|
||||
assertFalse(MovingPlatformLaunchPolicy.ready(snapshot(1_150f, true, true, false), 1_150f));
|
||||
assertTrue(MovingPlatformLaunchPolicy.ready(snapshot(1_150f, true, true, true), 1_150f));
|
||||
}
|
||||
|
||||
private static GameView.AutomationSnapshot snapshot(
|
||||
float platformX, boolean supported, boolean grounded, boolean powered
|
||||
) {
|
||||
return new GameView.AutomationSnapshot(
|
||||
false, true, true, false, false, 8,
|
||||
4_000L, 1_100f, 670f, 0, 0,
|
||||
platformX, 770f, supported, powered, Float.NaN, grounded
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.projectsacrifice.game;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
public final class PlaytestSimulationBudgetTest {
|
||||
@Test
|
||||
public void slowRenderingUsesSimulationBudgetWithASeparateWallWatchdog() {
|
||||
PlaytestSimulationBudget budget = PlaytestSimulationBudget.start(0L, 0L, 500L);
|
||||
|
||||
assertFalse("Host time may outrun active simulation", budget.exhausted(96L, 1_000L));
|
||||
assertTrue("Simulation budget remains authoritative", budget.exhausted(500L, 5_000L));
|
||||
|
||||
PlaytestSimulationBudget frozen = PlaytestSimulationBudget.start(0L, 0L, 5_000L);
|
||||
assertFalse(frozen.exhausted(0L, 119_999L));
|
||||
assertTrue("Frozen rendering stops at the same watchdog as the generic bot",
|
||||
frozen.exhausted(0L, 120_000L));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user