Forenkler skjermer og fjerner en bug som gjorde at knapper hang fast

This commit is contained in:
2020-04-23 15:27:48 +02:00
parent 8676434326
commit 5f3c84e842
14 changed files with 60 additions and 136 deletions

View File

@@ -180,7 +180,7 @@ public class Board {
Robot alternateRobot = getRobotFromDeadRobots(robotID);
if (robots.containsKey(robotID)) {
robots.get(robotID).setPowerDown(powerDown);
} else if ( alternateRobot != null) {
} else if (alternateRobot != null) {
alternateRobot.setPowerDown(powerDown);
}
}
@@ -409,7 +409,7 @@ public class Board {
//If another robot is standing on a conveyor belt pointing to the tile in front, a conflict happens
return (isValidPosition(frontLeftPosition) && isConveyorBelt(getTileOnPosition(frontLeftPosition)) &&
getTileOnPosition(frontLeftPosition).getDirection() ==
Direction.getRightRotatedDirection(conveyorBeltDirection) && hasRobotOnPosition(frontLeftPosition)) ||
Direction.getRightRotatedDirection(conveyorBeltDirection) && hasRobotOnPosition(frontLeftPosition)) ||
(isValidPosition(frontRightPosition) && isConveyorBelt(getTileOnPosition(frontRightPosition))
&& getTileOnPosition(frontRightPosition).getDirection() ==
Direction.getLeftRotatedDirection(conveyorBeltDirection)

View File

@@ -21,11 +21,11 @@ public class Phase {
private final Board gameBoard;
private final List<Player> playerList;
private final int cycleDelay;
private final InteractableGame game;
private List<BoardElementContainer<Tile>> cogwheels;
private List<BoardElementContainer<Tile>> conveyorBelts;
private List<BoardElementContainer<Tile>> fastConveyorBelts;
private List<BoardElementContainer<Tile>> flags;
private final InteractableGame game;
/**
* Instantiates a new phase

View File

@@ -24,6 +24,7 @@ public class RoboRallyGame implements DrawableGame, InteractableGame {
private final boolean host;
private final String playerName;
private final RoboRallyServer server;
private final Phase phase;
private Board gameBoard;
private List<BoardElementContainer<Tile>> repairTiles;
private Deck<ProgrammingCard> mainDeck;
@@ -31,7 +32,6 @@ public class RoboRallyGame implements DrawableGame, InteractableGame {
private String winningPlayerName;
private List<ProgrammingCard> program;
private ProgrammingCardDeck playerHand;
private final Phase phase;
/**
* Instantiates a new Robo Rally game