From 1319536671b8d49789a6e7f136047458b1d96590 Mon Sep 17 00:00:00 2001 From: Dennis Weinberger Date: Tue, 26 Mar 2019 20:37:56 +0000 Subject: [PATCH] Update MapPanel.java - sysouts --- Projektgruppe_175/src/gui/components/MapPanel.java | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/Projektgruppe_175/src/gui/components/MapPanel.java b/Projektgruppe_175/src/gui/components/MapPanel.java index 02d4d54..42477ec 100644 --- a/Projektgruppe_175/src/gui/components/MapPanel.java +++ b/Projektgruppe_175/src/gui/components/MapPanel.java @@ -170,30 +170,23 @@ public class MapPanel extends JScrollPane { if(scared.getOwner() == game.getCurrentPlayer()) { return; } - System.out.println("Ausgewählt: " + scared.getName()); List> castleEdges = map.getEdges(); List adjacentCastles = new ArrayList<>(); for(Edge edge : castleEdges) { if(edge.getNodeA().getValue().equals(scared)) { if(edge.getNodeB().getValue().getOwner() != game.getCurrentPlayer() && !edge.getNodeB().getValue().equals(scared)) { adjacentCastles.add(edge.getNodeB().getValue()); - System.out.print("added: " + edge.getNodeB().getValue().getName()); } } else if(edge.getNodeB().getValue().equals(scared)) { if(edge.getNodeA().getValue().getOwner() != game.getCurrentPlayer() && !edge.getNodeA().getValue().equals(scared)) { adjacentCastles.add(edge.getNodeA().getValue()); - System.out.print("added: " + edge.getNodeA().getValue().getName()); } } } int troopsToDistribute = scared.getTroopCount() - 1; - System.out.println(troopsToDistribute); scared.removeTroops(troopsToDistribute); - System.out.println(adjacentCastles.size()); - for(Castle c : adjacentCastles) { - System.out.print(c.getName() + " "); - } + if(adjacentCastles.isEmpty()) { gameView.revalidate(); @@ -206,7 +199,6 @@ public class MapPanel extends JScrollPane { Random random = new Random(); for(int i = 0; i < troopsToDistribute; i++) { int castleNumber = random.nextInt(adjacentCastles.size()); - System.out.print(castleNumber + " "); adjacentCastles.get(castleNumber).addTroops(1); }