Завершить интеграционную устойчивость ботов этапа 3

This commit is contained in:
2026-08-18 18:27:33 +03:00
parent a8d72024f2
commit 9d792bdee4
8 changed files with 156 additions and 44 deletions
@@ -6,22 +6,35 @@ import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
public final class MovingPlatformLaunchPolicyTest {
@Test
public void boardingWaitsForThePoweredOutboundPhaseNearTheLeftFloor() {
assertFalse(MovingPlatformLaunchPolicy.readyToBoard(
snapshot(1_000f, false, true, true, false), 1_050f));
assertFalse(MovingPlatformLaunchPolicy.readyToBoard(
snapshot(1_000f, false, true, false, true), 1_050f));
assertFalse(MovingPlatformLaunchPolicy.readyToBoard(
snapshot(1_100f, false, true, true, true), 1_050f));
assertTrue(MovingPlatformLaunchPolicy.readyToBoard(
snapshot(1_000f, false, true, true, true), 1_050f));
}
@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));
assertFalse(MovingPlatformLaunchPolicy.ready(snapshot(910f, true, true, true, true), 1_150f));
assertFalse(MovingPlatformLaunchPolicy.ready(snapshot(1_150f, false, true, true, true), 1_150f));
assertFalse(MovingPlatformLaunchPolicy.ready(snapshot(1_150f, true, false, true, true), 1_150f));
assertFalse(MovingPlatformLaunchPolicy.ready(snapshot(1_150f, true, true, false, true), 1_150f));
assertTrue(MovingPlatformLaunchPolicy.ready(snapshot(1_150f, true, true, true, true), 1_150f));
}
private static GameView.AutomationSnapshot snapshot(
float platformX, boolean supported, boolean grounded, boolean powered
float platformX, boolean supported, boolean grounded, boolean powered,
boolean movingRight
) {
return new GameView.AutomationSnapshot(
false, true, true, false, false, 8,
4_000L, 1_100f, 670f, 0, 0,
platformX, 770f, supported, powered, Float.NaN, grounded
platformX, 770f, supported, powered, movingRight, Float.NaN, grounded
);
}
}