From 03ed01a2f910b26177a9699439c42dbe13c97904 Mon Sep 17 00:00:00 2001 From: GabrielMagnus Date: Tue, 24 Mar 2020 21:41:04 +0100 Subject: [PATCH] =?UTF-8?q?Fikset=20bugs=20med=20implementasjon=20for=20be?= =?UTF-8?q?vegelse=20av=20transportb=C3=A5nd,=20ryddet=20debuggingkode?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Parprogrammering med Torbjørn --- .../inf112/fiasko/roborally/objects/RoboRallyGame.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/main/java/inf112/fiasko/roborally/objects/RoboRallyGame.java b/src/main/java/inf112/fiasko/roborally/objects/RoboRallyGame.java index f38d121..0d6abcf 100644 --- a/src/main/java/inf112/fiasko/roborally/objects/RoboRallyGame.java +++ b/src/main/java/inf112/fiasko/roborally/objects/RoboRallyGame.java @@ -296,9 +296,7 @@ public class RoboRallyGame implements IDrawableGame { List> conveyorBeltsWithRobotsThatShouldMove = conveyorBeltsThatCanMoveWithoutConflict(conveyorBelts); for (BoardElementContainer 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 nextConveyorBelt = new BoardElementContainer<>(nextTile, newPosition); - BoardElementContainer lastInRow = findLastRobotInRow (nextConveyorBelt, conveyorBeltsWithRobotsOn); + BoardElementContainer lastInRow = findLastRobotInRow (conveyorBeltWithRobot, conveyorBeltsWithRobotsOn); List> listOfRow = new ArrayList<>(); List> results = findFirstRobotInRow(lastInRow, conveyorBeltsWithRobotsOn, listOfRow); @@ -406,8 +404,6 @@ public class RoboRallyGame implements IDrawableGame { } } - - private List> listOfConveyorBeltsWithRobotPointingAtTile(Boolean forward, BoardElementContainer currentTile, List> conveyorBeltsWithRobots) {