Устранить нагрузочные флаки финальной матрицы
This commit is contained in:
@@ -60,6 +60,7 @@ public final class GameView extends View implements Runnable {
|
||||
private final boolean playerOnMovingPlatform;
|
||||
private final boolean firstMovingPlatformPowered;
|
||||
private final boolean firstMovingPlatformMovingRight;
|
||||
private final boolean firstMovingPlatformMovingDown;
|
||||
private final float firstCorpseX;
|
||||
private final boolean playerOnGround;
|
||||
|
||||
@@ -95,6 +96,23 @@ public final class GameView extends View implements Runnable {
|
||||
boolean firstMovingPlatformPowered,
|
||||
boolean firstMovingPlatformMovingRight, float firstCorpseX,
|
||||
boolean playerOnGround) {
|
||||
this(completed, playerAlive, allDoorsOpen, visiblyPaused, inputActive, levelNumber,
|
||||
elapsedMilliseconds, playerX, playerY, deaths, corpseCount,
|
||||
firstMovingPlatformX, firstMovingPlatformY, playerOnMovingPlatform,
|
||||
firstMovingPlatformPowered, firstMovingPlatformMovingRight, 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,
|
||||
boolean firstMovingPlatformMovingDown, float firstCorpseX,
|
||||
boolean playerOnGround) {
|
||||
this.completed = completed;
|
||||
this.playerAlive = playerAlive;
|
||||
this.allDoorsOpen = allDoorsOpen;
|
||||
@@ -111,6 +129,7 @@ public final class GameView extends View implements Runnable {
|
||||
this.playerOnMovingPlatform = playerOnMovingPlatform;
|
||||
this.firstMovingPlatformPowered = firstMovingPlatformPowered;
|
||||
this.firstMovingPlatformMovingRight = firstMovingPlatformMovingRight;
|
||||
this.firstMovingPlatformMovingDown = firstMovingPlatformMovingDown;
|
||||
this.firstCorpseX = firstCorpseX;
|
||||
this.playerOnGround = playerOnGround;
|
||||
}
|
||||
@@ -131,6 +150,7 @@ public final class GameView extends View implements Runnable {
|
||||
public boolean playerOnMovingPlatform() { return playerOnMovingPlatform; }
|
||||
public boolean firstMovingPlatformPowered() { return firstMovingPlatformPowered; }
|
||||
public boolean firstMovingPlatformMovingRight() { return firstMovingPlatformMovingRight; }
|
||||
public boolean firstMovingPlatformMovingDown() { return firstMovingPlatformMovingDown; }
|
||||
public float firstCorpseX() { return firstCorpseX; }
|
||||
public boolean playerOnGround() { return playerOnGround; }
|
||||
}
|
||||
@@ -1977,12 +1997,14 @@ public final class GameView extends View implements Runnable {
|
||||
float firstMovingPlatformY = Float.NaN;
|
||||
boolean firstMovingPlatformPowered = false;
|
||||
boolean firstMovingPlatformMovingRight = false;
|
||||
boolean firstMovingPlatformMovingDown = 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;
|
||||
firstMovingPlatformMovingDown = state.y > state.previousY;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -2007,6 +2029,7 @@ public final class GameView extends View implements Runnable {
|
||||
playerOnMovingPlatform,
|
||||
firstMovingPlatformPowered,
|
||||
firstMovingPlatformMovingRight,
|
||||
firstMovingPlatformMovingDown,
|
||||
corpses.isEmpty() ? Float.NaN : corpses.get(0).x,
|
||||
player.onGround
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user