renamed Method getTextView to toString in SiedlerBoard

This commit is contained in:
schrom01 2021-12-10 18:06:43 +01:00
parent 0ea44905e2
commit 70b2415b6b
4 changed files with 8 additions and 8 deletions

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="ProjectRootManager" version="2" languageLevel="JDK_X" default="true" project-jdk-name="openjdk-17" project-jdk-type="JavaSDK"> <component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="openjdk-17" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" /> <output url="file://$PROJECT_DIR$/out" />
</component> </component>
</project> </project>

View File

@ -31,7 +31,7 @@ public class Siedler {
boolean diceThrown = false; boolean diceThrown = false;
while (running) { while (running) {
Config.Faction currentPlayerFaction = game.getCurrentPlayerFaction(); Config.Faction currentPlayerFaction = game.getCurrentPlayerFaction();
parser.displayGameboard(game.getBoard().getTextView()); parser.displayGameboard(game.getBoard().toString());
parser.playerTurn(currentPlayerFaction); parser.playerTurn(currentPlayerFaction);
if (!diceThrown) { if (!diceThrown) {
throwDice(parser, game); 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. * @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) { private static void buildStructuresInFoundingPhase(Parser parser, SiedlerGame game, Boolean payout) {
parser.displayGameboard(game.getBoard().getTextView()); parser.displayGameboard(game.getBoard().toString());
parser.playerTurn(game.getCurrentPlayerFaction()); parser.playerTurn(game.getCurrentPlayerFaction());
//build Settlement //build Settlement
@ -185,7 +185,7 @@ public class Siedler {
} while (!successful); } while (!successful);
//build Road //build Road
parser.displayGameboard(game.getBoard().getTextView()); parser.displayGameboard(game.getBoard().toString());
parser.giveCoordinatesForStructures(Config.Structure.ROAD); parser.giveCoordinatesForStructures(Config.Structure.ROAD);
successful = false; successful = false;
do { do {

View File

@ -72,7 +72,7 @@ public class SiedlerBoard extends HexBoard<Config.Land, Settlement, Road, String
* *
* @return String of actual board. * @return String of actual board.
*/ */
public String getTextView() { public String toString() {
SiedlerBoardTextView view = new SiedlerBoardTextView(this); SiedlerBoardTextView view = new SiedlerBoardTextView(this);
for (Map.Entry<Point, Field> field : fields.entrySet()) { for (Map.Entry<Point, Field> field : fields.entrySet()) {
view.setLowerFieldLabel(field.getKey(), field.getValue().getLabel()); view.setLowerFieldLabel(field.getKey(), field.getValue().getLabel());

View File

@ -107,7 +107,7 @@ public class SiedlerGameTest {
@DisplayName("Test") @DisplayName("Test")
public void TestHandle7() { public void TestHandle7() {
SiedlerGame game = startGame(); SiedlerGame game = startGame();
//todo
} }
} }
@ -229,7 +229,7 @@ public class SiedlerGameTest {
public void TestGameAfterSetupPhase() { public void TestGameAfterSetupPhase() {
SiedlerGame game = gameAfterSetupPhase(); SiedlerGame game = gameAfterSetupPhase();
System.out.println(game.getBoard().getTextView()); System.out.println(game.getBoard().toString());
throwDiceSeveralTimes(game, 5, 5); throwDiceSeveralTimes(game, 5, 5);
throwDiceSeveralTimes(game, 5, 5); throwDiceSeveralTimes(game, 5, 5);
@ -311,7 +311,7 @@ public class SiedlerGameTest {
game.placeInitialRoad(secondRoad.first, secondRoad.second); game.placeInitialRoad(secondRoad.first, secondRoad.second);
} }
System.out.println(game.getBoard().getTextView()); System.out.println(game.getBoard().toString());
return game; return game;
} }