Fikset bugs med implementasjon for bevegelse av transportbånd, ryddet debuggingkode

Parprogrammering med Torbjørn
This commit is contained in:
GabrielMagnus 2020-03-24 21:41:04 +01:00
parent 81f832df55
commit 03ed01a2f9

View File

@ -296,9 +296,7 @@ public class RoboRallyGame implements IDrawableGame {
List<BoardElementContainer<Tile>> conveyorBeltsWithRobotsThatShouldMove =
conveyorBeltsThatCanMoveWithoutConflict(conveyorBelts);
for (BoardElementContainer<Tile> conveyorBelt : conveyorBeltsWithRobotsThatShouldMove) {
System.out.println(gameBoard.getTileOnPosition(conveyorBelt.getPosition()).getTileType().toString());
System.out.println(conveyorBelt.getPosition().toString());
System.out.println(gameBoard.getRobotOnPosition(conveyorBelt.getPosition()));
Direction currentDirection = conveyorBelt.getElement().getDirection();
RobotID robot = gameBoard.getRobotOnPosition(conveyorBelt.getPosition());
Position newPosition = gameBoard.getNewPosition(conveyorBelt.getPosition(), currentDirection);
@ -338,7 +336,7 @@ public class RoboRallyGame implements IDrawableGame {
Tile nextTile = gameBoard.getTileOnPosition(newPosition);
BoardElementContainer<Tile> nextConveyorBelt = new BoardElementContainer<>(nextTile, newPosition);
BoardElementContainer<Tile> lastInRow = findLastRobotInRow (nextConveyorBelt, conveyorBeltsWithRobotsOn);
BoardElementContainer<Tile> lastInRow = findLastRobotInRow (conveyorBeltWithRobot, conveyorBeltsWithRobotsOn);
List<BoardElementContainer<Tile>> listOfRow = new ArrayList<>();
List<BoardElementContainer<Tile>> results = findFirstRobotInRow(lastInRow, conveyorBeltsWithRobotsOn,
listOfRow);
@ -406,8 +404,6 @@ public class RoboRallyGame implements IDrawableGame {
}
}
private List<BoardElementContainer<Tile>> listOfConveyorBeltsWithRobotPointingAtTile(Boolean forward,
BoardElementContainer<Tile> currentTile,
List<BoardElementContainer<Tile>> conveyorBeltsWithRobots) {