Завершить интеграционную устойчивость ботов этапа 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
@@ -59,6 +59,7 @@ public final class GameView extends View implements Runnable {
private final float firstMovingPlatformY;
private final boolean playerOnMovingPlatform;
private final boolean firstMovingPlatformPowered;
private final boolean firstMovingPlatformMovingRight;
private final float firstCorpseX;
private final boolean playerOnGround;
@@ -68,7 +69,7 @@ public final class GameView extends View implements Runnable {
float playerX, float playerY, int deaths, int corpseCount) {
this(completed, playerAlive, allDoorsOpen, visiblyPaused, inputActive, levelNumber,
elapsedMilliseconds, playerX, playerY, deaths, corpseCount,
Float.NaN, Float.NaN, false, false, Float.NaN, false);
Float.NaN, Float.NaN, false, false, false, Float.NaN, false);
}
AutomationSnapshot(boolean completed, boolean playerAlive, boolean allDoorsOpen,
@@ -79,6 +80,21 @@ public final class GameView extends View implements Runnable {
boolean playerOnMovingPlatform,
boolean firstMovingPlatformPowered, float firstCorpseX,
boolean playerOnGround) {
this(completed, playerAlive, allDoorsOpen, visiblyPaused, inputActive, levelNumber,
elapsedMilliseconds, playerX, playerY, deaths, corpseCount,
firstMovingPlatformX, firstMovingPlatformY, playerOnMovingPlatform,
firstMovingPlatformPowered, false, firstCorpseX, playerOnGround);
}
AutomationSnapshot(boolean completed, boolean playerAlive, boolean allDoorsOpen,
boolean visiblyPaused, boolean inputActive, int levelNumber,
long elapsedMilliseconds,
float playerX, float playerY, int deaths, int corpseCount,
float firstMovingPlatformX, float firstMovingPlatformY,
boolean playerOnMovingPlatform,
boolean firstMovingPlatformPowered,
boolean firstMovingPlatformMovingRight, float firstCorpseX,
boolean playerOnGround) {
this.completed = completed;
this.playerAlive = playerAlive;
this.allDoorsOpen = allDoorsOpen;
@@ -94,6 +110,7 @@ public final class GameView extends View implements Runnable {
this.firstMovingPlatformY = firstMovingPlatformY;
this.playerOnMovingPlatform = playerOnMovingPlatform;
this.firstMovingPlatformPowered = firstMovingPlatformPowered;
this.firstMovingPlatformMovingRight = firstMovingPlatformMovingRight;
this.firstCorpseX = firstCorpseX;
this.playerOnGround = playerOnGround;
}
@@ -113,6 +130,7 @@ public final class GameView extends View implements Runnable {
public float firstMovingPlatformY() { return firstMovingPlatformY; }
public boolean playerOnMovingPlatform() { return playerOnMovingPlatform; }
public boolean firstMovingPlatformPowered() { return firstMovingPlatformPowered; }
public boolean firstMovingPlatformMovingRight() { return firstMovingPlatformMovingRight; }
public float firstCorpseX() { return firstCorpseX; }
public boolean playerOnGround() { return playerOnGround; }
}
@@ -1958,11 +1976,13 @@ public final class GameView extends View implements Runnable {
float firstMovingPlatformX = Float.NaN;
float firstMovingPlatformY = Float.NaN;
boolean firstMovingPlatformPowered = false;
boolean firstMovingPlatformMovingRight = false;
for (PlatformState state : platformStates) {
if (state.definition.isMoving()) {
firstMovingPlatformX = state.x;
firstMovingPlatformY = state.y;
firstMovingPlatformPowered = signalActive(state.definition.controlId);
firstMovingPlatformMovingRight = state.x > state.previousX;
break;
}
}
@@ -1986,6 +2006,7 @@ public final class GameView extends View implements Runnable {
firstMovingPlatformY,
playerOnMovingPlatform,
firstMovingPlatformPowered,
firstMovingPlatformMovingRight,
corpses.isEmpty() ? Float.NaN : corpses.get(0).x,
player.onGround
);