From 70b2415b6ba40d2b03620d28926c79961e74b10b Mon Sep 17 00:00:00 2001 From: schrom01 Date: Fri, 10 Dec 2021 18:06:43 +0100 Subject: [PATCH 1/2] renamed Method getTextView to toString in SiedlerBoard --- .idea/misc.xml | 2 +- src/ch/zhaw/catan/Siedler.java | 6 +++--- src/ch/zhaw/catan/SiedlerBoard.java | 2 +- test/ch/zhaw/catan/SiedlerGameTest.java | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.idea/misc.xml b/.idea/misc.xml index b573818..c3dfb30 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/src/ch/zhaw/catan/Siedler.java b/src/ch/zhaw/catan/Siedler.java index 5df282c..146e2ca 100644 --- a/src/ch/zhaw/catan/Siedler.java +++ b/src/ch/zhaw/catan/Siedler.java @@ -31,7 +31,7 @@ public class Siedler { boolean diceThrown = false; while (running) { Config.Faction currentPlayerFaction = game.getCurrentPlayerFaction(); - parser.displayGameboard(game.getBoard().getTextView()); + parser.displayGameboard(game.getBoard().toString()); parser.playerTurn(currentPlayerFaction); if (!diceThrown) { throwDice(parser, game); @@ -170,7 +170,7 @@ public class Siedler { * @param payout true (for second Settlement in founding Phase): the Player gets a payout for the settlement. false (for first Settlement in founding Phase): The Player gets no payout. */ private static void buildStructuresInFoundingPhase(Parser parser, SiedlerGame game, Boolean payout) { - parser.displayGameboard(game.getBoard().getTextView()); + parser.displayGameboard(game.getBoard().toString()); parser.playerTurn(game.getCurrentPlayerFaction()); //build Settlement @@ -185,7 +185,7 @@ public class Siedler { } while (!successful); //build Road - parser.displayGameboard(game.getBoard().getTextView()); + parser.displayGameboard(game.getBoard().toString()); parser.giveCoordinatesForStructures(Config.Structure.ROAD); successful = false; do { diff --git a/src/ch/zhaw/catan/SiedlerBoard.java b/src/ch/zhaw/catan/SiedlerBoard.java index 0619c57..9283ed7 100644 --- a/src/ch/zhaw/catan/SiedlerBoard.java +++ b/src/ch/zhaw/catan/SiedlerBoard.java @@ -72,7 +72,7 @@ public class SiedlerBoard extends HexBoard field : fields.entrySet()) { view.setLowerFieldLabel(field.getKey(), field.getValue().getLabel()); diff --git a/test/ch/zhaw/catan/SiedlerGameTest.java b/test/ch/zhaw/catan/SiedlerGameTest.java index 46bbb1b..29fa1e7 100644 --- a/test/ch/zhaw/catan/SiedlerGameTest.java +++ b/test/ch/zhaw/catan/SiedlerGameTest.java @@ -107,7 +107,7 @@ public class SiedlerGameTest { @DisplayName("Test") public void TestHandle7() { SiedlerGame game = startGame(); - + //todo } } @@ -229,7 +229,7 @@ public class SiedlerGameTest { public void TestGameAfterSetupPhase() { SiedlerGame game = gameAfterSetupPhase(); - System.out.println(game.getBoard().getTextView()); + System.out.println(game.getBoard().toString()); throwDiceSeveralTimes(game, 5, 5); throwDiceSeveralTimes(game, 5, 5); @@ -311,7 +311,7 @@ public class SiedlerGameTest { game.placeInitialRoad(secondRoad.first, secondRoad.second); } - System.out.println(game.getBoard().getTextView()); + System.out.println(game.getBoard().toString()); return game; } From 6a5b7f22451302e487fb44c3f1d39703991e5ca5 Mon Sep 17 00:00:00 2001 From: schrom01 Date: Fri, 10 Dec 2021 18:06:52 +0100 Subject: [PATCH 2/2] renamed Method getTextView to toString in SiedlerBoard --- test/ch/zhaw/catan/SiedlerBoardTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/ch/zhaw/catan/SiedlerBoardTest.java b/test/ch/zhaw/catan/SiedlerBoardTest.java index ccaa83d..0af1f04 100644 --- a/test/ch/zhaw/catan/SiedlerBoardTest.java +++ b/test/ch/zhaw/catan/SiedlerBoardTest.java @@ -38,7 +38,7 @@ public class SiedlerBoardTest { @Test public void testLongestRoadSimple() { - System.out.println(board.getTextView()); + System.out.println(board.toString()); assertEquals(Config.Faction.BLUE, board.getLongestRoadFaction(factionList)); assertEquals(6, board.getLongestRoadLength()); @@ -47,7 +47,7 @@ public class SiedlerBoardTest { @Test public void testLongestRoadWithInterrupt() { board.setCorner(new Point(4, 10), new Settlement(Config.Faction.RED, new Point(4, 10))); - System.out.println(board.getTextView()); + System.out.println(board.toString()); assertEquals(Config.Faction.BLUE, board.getLongestRoadFaction(factionList)); assertEquals(5, board.getLongestRoadLength());