Browse Source
Merge branch 'develop' of https://github.com/RedEagle-dh/BitBiome into develop
remotes/origin/develop
Merge branch 'develop' of https://github.com/RedEagle-dh/BitBiome into develop
remotes/origin/develop
Juliakn66
2 years ago
15 changed files with 713 additions and 84 deletions
-
4playerconfig.json
-
52src/main/java/org/bitbiome/classes/TravelEngine.java
-
2src/main/java/org/bitbiome/commands/CommandListener.java
-
23src/main/java/org/bitbiome/commands/GoldCommand.java
-
9src/main/java/org/bitbiome/commands/HelpCommand.java
-
94src/main/java/org/bitbiome/commands/MapCommand.java
-
85src/main/java/org/bitbiome/commands/TravelCommand.java
-
8src/main/java/org/bitbiome/entities/Player.java
-
64src/main/resources/gameconfig.json
-
221src/main/resources/items.json
-
59src/main/resources/mobs.json
-
2src/main/resources/playerconfig.json
-
0src/test/java/org/bitbiome/commands/HelpCommandTest.java
-
2src/test/java/org/bitbiome/commands/LocationCommandTest.java
-
172src/test/java/org/bitbiome/commands/MapCommandTest.java
@ -0,0 +1,23 @@ |
|||
package org.bitbiome.commands; |
|||
|
|||
import java.util.Scanner; |
|||
|
|||
import org.bitbiome.classes.TravelEngine; |
|||
import org.bitbiome.entities.Player; |
|||
|
|||
|
|||
|
|||
|
|||
public class GoldCommand implements CommandAPI{ |
|||
|
|||
|
|||
public static String getGoldMessage(Player player) { |
|||
return "Du hast " + player.getGold() + " Gold"; |
|||
} |
|||
|
|||
@Override |
|||
public void performCommand(Scanner scanner, boolean isRunning, String message, TravelEngine travelEngine) { |
|||
System.out.println(getGoldMessage(travelEngine.getPlayer())); |
|||
return; |
|||
} |
|||
} |
@ -0,0 +1,94 @@ |
|||
package org.bitbiome.commands; |
|||
import org.bitbiome.classes.TravelEngine; |
|||
import org.json.JSONArray; |
|||
import java.util.Scanner; |
|||
import org.bitbiome.classes.Colors; |
|||
|
|||
public class MapCommand implements CommandAPI{ |
|||
@Override |
|||
public void performCommand(Scanner scanner, boolean isRunning, String message, TravelEngine travelEngine) { |
|||
System.out.println(getMapMessage(travelEngine)); |
|||
} |
|||
public static String getLocationMessage(TravelEngine travelEngine) { |
|||
return "Du befindest dich gerade hier: " + Colors.ANSI_GREEN + travelEngine.getPlayer().getLocation().getName() + "\n" + Colors.ANSI_RESET; |
|||
} |
|||
private static String textColor(String text, String color) { |
|||
return color + text + Colors.ANSI_RESET; |
|||
} |
|||
|
|||
private static String textBlack(String text) { |
|||
return textColor(text,Colors.ANSI_BRIGHT_BLACK); |
|||
} |
|||
private static String textBlue(String text) { |
|||
return textColor(text,Colors.ANSI_BLUE); |
|||
} |
|||
private static String textGreen(String text) { |
|||
return textColor(text,Colors.ANSI_GREEN); |
|||
} |
|||
private static String signup() { |
|||
return (" __________________________________________________________________________________________________\n"); |
|||
} |
|||
private static String signdown() { |
|||
return ("|________________________________|________________________________|________________________________|\n"); |
|||
} |
|||
private static String signmiddle() { |
|||
return ("| | | |\n"); |
|||
} |
|||
private static String mapup(TravelEngine travelEngine) { |
|||
return getLocationMessage(travelEngine) + "Zu den " + textBlue("blau ") + "markierten Standorten kannst du reisen\n\nDeine Karte:\n\n" + signup() + signmiddle() + signmiddle(); |
|||
} |
|||
private static String mapmiddle() { |
|||
return signmiddle() + signdown() + signmiddle() + signmiddle(); |
|||
} |
|||
private static String mapdown() { |
|||
return signmiddle() + signdown(); |
|||
} |
|||
public static String getMapMessage(TravelEngine travelEngine) { |
|||
StringBuilder outputMessage = new StringBuilder(); |
|||
JSONArray locations = travelEngine.getLocationList(); |
|||
String locationWueste = locations.getJSONObject(5).getString("name"); |
|||
String locationGruenland = locations.getJSONObject(4).getString("name"); |
|||
String locationWinterland = locations.getJSONObject(2).getString("name"); |
|||
String locationStrand = locations.getJSONObject(1).getString("name"); |
|||
String locationWald = locations.getJSONObject(0).getString("name"); |
|||
String locationBerge = locations.getJSONObject(3).getString("name"); |
|||
|
|||
if (travelEngine.getPlayer().getLocation().getName().equalsIgnoreCase("Wald")) { |
|||
outputMessage |
|||
.append(mapup(travelEngine)).append("| ").append(textBlack(locationWueste)).append(" | ").append(textBlue(locationGruenland)).append(" | ").append(textBlack(locationWinterland)).append(" |").append("\n") |
|||
.append(mapmiddle()).append("| ").append(textBlue(locationStrand)).append(" | ").append(textGreen(locationWald)).append(" | ").append(textBlue(locationBerge)).append(" |").append("\n") |
|||
.append(mapdown()); |
|||
} else if (travelEngine.getPlayer().getLocation().getName().equalsIgnoreCase("Strand")) { |
|||
outputMessage |
|||
.append(mapup(travelEngine)).append("| ").append(textBlue(locationWueste)).append(" | ").append(textBlack(locationGruenland)).append(" | ").append(textBlack(locationWinterland)).append(" |").append("\n") |
|||
.append(mapmiddle()).append("| ").append(textGreen(locationStrand)).append(" | ").append(textBlue(locationWald)).append(" | ").append(textBlack(locationBerge)).append(" |").append("\n") |
|||
.append(mapdown()); |
|||
|
|||
} else if (travelEngine.getPlayer().getLocation().getName().equalsIgnoreCase("Berge")) { |
|||
outputMessage |
|||
.append(mapup(travelEngine)).append("| ").append(textBlack(locationWueste)).append(" | ").append(textBlack(locationGruenland)).append(" | ").append(textBlue(locationWinterland)).append(" |").append("\n") |
|||
.append(mapmiddle()).append("| ").append(textBlack(locationStrand)).append(" | ").append(textBlue(locationWald)).append(" | ").append(textGreen(locationBerge)).append(" |").append("\n") |
|||
.append(mapdown()); |
|||
|
|||
} else if (travelEngine.getPlayer().getLocation().getName().equalsIgnoreCase("Wueste")) { |
|||
outputMessage |
|||
.append(mapup(travelEngine)).append("| ").append(textGreen(locationWueste)).append(" | ").append(textBlue(locationGruenland)).append(" | ").append(textBlack(locationWinterland)).append(" |").append("\n") |
|||
.append(mapmiddle()).append("| ").append(textBlue(locationStrand)).append(" | ").append(textBlack(locationWald)).append(" | ").append(textBlack(locationBerge)).append(" |").append("\n") |
|||
.append(mapdown()); |
|||
|
|||
} else if (travelEngine.getPlayer().getLocation().getName().equalsIgnoreCase("Gruenland")) { |
|||
outputMessage |
|||
.append(mapup(travelEngine)).append("| ").append(textBlue(locationWueste)).append(" | ").append(textGreen(locationGruenland)).append(" | ").append(textBlue(locationWinterland)).append(" |").append("\n") |
|||
.append(mapmiddle()).append("| ").append(textBlack(locationStrand)).append(" | ").append(textBlue(locationWald)).append(" | ").append(textBlack(locationBerge)).append(" |").append("\n") |
|||
.append(mapdown()); |
|||
|
|||
} else { |
|||
outputMessage |
|||
.append(mapup(travelEngine)).append("| ").append(textBlack(locationWueste)).append(" | ").append(textBlue(locationGruenland)).append(" | ").append(textGreen(locationWinterland)).append(" |").append("\n") |
|||
.append(mapmiddle()).append("| ").append(textBlack(locationStrand)).append(" | ").append(textBlack(locationWald)).append(" | ").append(textBlue(locationBerge)).append(" |").append("\n") |
|||
.append(mapdown()); |
|||
} |
|||
return outputMessage.toString(); |
|||
} |
|||
|
|||
} |
@ -1,39 +1,182 @@ |
|||
|
|||
[ |
|||
{ |
|||
"name": "Holz", |
|||
"damage": "1-3", |
|||
"crafting": true, |
|||
"doesDamage": true, |
|||
"durability": 1000, |
|||
"amountShop": 10, |
|||
"gold": 10 |
|||
}, |
|||
{ |
|||
"name": "Heiliges Schwert der Engel", |
|||
"damage": "1000", |
|||
"crafting": false, |
|||
"doesDamage": true, |
|||
"durability": 1000, |
|||
"amountShop": 1, |
|||
"gold": 1000 |
|||
}, |
|||
{ |
|||
"name": "Stein", |
|||
"damage": "5-10", |
|||
"crafting": true, |
|||
"doesDamage": true, |
|||
"durability": 1000, |
|||
"amountShop": 1500, |
|||
"gold": 2 |
|||
}, |
|||
{ |
|||
"name": "Fell", |
|||
"damage": "0", |
|||
"crafting": true, |
|||
"doesDamage": false, |
|||
"durability": 1000, |
|||
"amountShop": 500, |
|||
"gold": 100 |
|||
} |
|||
] |
|||
[ |
|||
{ |
|||
"name": "Holz", |
|||
"damage": "2", |
|||
"crafting": true, |
|||
"durability": 1000, |
|||
"doesDamage": true, |
|||
"amountShop": 10, |
|||
"gold": 10 |
|||
}, |
|||
{ |
|||
"name": "Heiliges Schwert der Engel", |
|||
"damage": "1000", |
|||
"crafting": false, |
|||
"durability": 1000, |
|||
"doesDamage": true, |
|||
"amountShop": 1, |
|||
"gold": 1000 |
|||
}, |
|||
{ |
|||
"name": "Stein", |
|||
"damage": "7", |
|||
"crafting": true, |
|||
"durability": 1000, |
|||
"doesDamage": true, |
|||
"amountShop": 1500, |
|||
"gold": 2 |
|||
}, |
|||
{ |
|||
"name": "Fell", |
|||
"damage": "0", |
|||
"crafting": true, |
|||
"durability": 1000, |
|||
"doesDamage": false, |
|||
"amountShop": 500, |
|||
"gold": 100 |
|||
}, |
|||
{ |
|||
"name": "Sand", |
|||
"damage": "2", |
|||
"crafting": true, |
|||
"durability": 1000, |
|||
"doesDamage": true, |
|||
"amountShop": 1500, |
|||
"gold": 1 |
|||
}, |
|||
{ |
|||
"name": "Treibholz", |
|||
"damage": "1", |
|||
"crafting": true, |
|||
"durability": 1000, |
|||
"doesDamage": true, |
|||
"amountShop": 1000, |
|||
"gold": 1 |
|||
}, |
|||
{ |
|||
"name": "Krabbenschere", |
|||
"damage": "4", |
|||
"crafting": true, |
|||
"durability": 1000, |
|||
"doesDamage": true, |
|||
"amountShop": 750, |
|||
"gold": 1 |
|||
}, |
|||
{ |
|||
"name": "Eiszapfen", |
|||
"damage": "5", |
|||
"crafting": true, |
|||
"durability": 1000, |
|||
"doesDamage": true, |
|||
"amountShop": 1000, |
|||
"gold": 1 |
|||
}, |
|||
{ |
|||
"name": "Schnee", |
|||
"damage": "1", |
|||
"crafting": true, |
|||
"durability": 10, |
|||
"doesDamage": true, |
|||
"amountShop": 100, |
|||
"gold": 1 |
|||
}, |
|||
{ |
|||
"name": "Yetikralle", |
|||
"damage": "20", |
|||
"crafting": true, |
|||
"durability": 1000, |
|||
"doesDamage": true, |
|||
"amountShop": 250, |
|||
"gold": 5 |
|||
}, |
|||
{ |
|||
"name": "Loewenkralle", |
|||
"damage": "10", |
|||
"crafting": true, |
|||
"durability": 1000, |
|||
"doesDamage": true, |
|||
"amountShop": 400, |
|||
"gold": 3 |
|||
}, |
|||
{ |
|||
"name": "Feuerstein", |
|||
"damage": "0", |
|||
"crafting": true, |
|||
"durability": 1000, |
|||
"doesDamage": false, |
|||
"amountShop": 1500, |
|||
"gold": 2 |
|||
}, |
|||
{ |
|||
"name": "Quellwasser", |
|||
"damage": "0", |
|||
"crafting": true, |
|||
"durability": 5, |
|||
"doesDamage": false, |
|||
"amountShop": 1500, |
|||
"gold": 1 |
|||
}, |
|||
{ |
|||
"name": "Lehm", |
|||
"damage": "0", |
|||
"crafting": true, |
|||
"durability": 1000, |
|||
"doesDamage": false, |
|||
"amountShop": 3000, |
|||
"gold": 1 |
|||
}, |
|||
{ |
|||
"name": "Giftblume", |
|||
"damage": "15-20", |
|||
"crafting": true, |
|||
"durability": 1000, |
|||
"doesDamage": true, |
|||
"amountShop": 300, |
|||
"gold": 1 |
|||
}, |
|||
{ |
|||
"name": "Drachenzahn", |
|||
"damage": "5", |
|||
"crafting": true, |
|||
"durability": 1000, |
|||
"doesDamage": true, |
|||
"amountShop": 300, |
|||
"gold": 3 |
|||
}, |
|||
{ |
|||
"name": "Drachenhaut", |
|||
"damage": "0", |
|||
"crafting": true, |
|||
"durability": 1000, |
|||
"doesDamage": false, |
|||
"amountShop": 200, |
|||
"gold": 3 |
|||
}, |
|||
{ |
|||
"name": "Sand", |
|||
"damage": "1", |
|||
"crafting": true, |
|||
"durability": 1000, |
|||
"doesDamage": true, |
|||
"amountShop": 1500, |
|||
"gold": 1 |
|||
}, |
|||
{ |
|||
"name": "Knochen", |
|||
"damage": "6", |
|||
"crafting": true, |
|||
"durability": 1000, |
|||
"doesDamage": true, |
|||
"amountShop": 450, |
|||
"gold": 2 |
|||
}, |
|||
{ |
|||
"name": "Kaktus", |
|||
"damage": "5", |
|||
"crafting": true, |
|||
"durability": 1000, |
|||
"doesDamage": true, |
|||
"amountShop": 700, |
|||
"gold": 2 |
|||
} |
|||
] |
@ -0,0 +1,59 @@ |
|||
[ |
|||
{ |
|||
"name": "Big Foot", |
|||
"hp": 50, |
|||
"damage": "15", |
|||
"isFriendly": true, |
|||
"items": [ |
|||
"Fell" |
|||
] |
|||
}, |
|||
{ |
|||
"name": "Riesenkrabbe", |
|||
"hp": 50, |
|||
"damage": "9", |
|||
"isFriendly": false, |
|||
"items": [ |
|||
"Krabbenschere" |
|||
] |
|||
}, |
|||
{ |
|||
"name": "Yeti", |
|||
"hp": 55, |
|||
"damage": "17", |
|||
"isFriendly": true, |
|||
"items": [ |
|||
"Fell", |
|||
"Yetikralle" |
|||
] |
|||
}, |
|||
{ |
|||
"name": "Loewe", |
|||
"hp": 30, |
|||
"damage": "15", |
|||
"isFriendly": false, |
|||
"items": [ |
|||
"Fell", |
|||
"Loewenkralle" |
|||
] |
|||
}, |
|||
{ |
|||
"name": "Drache", |
|||
"hp": 55, |
|||
"damage": "20", |
|||
"isFriendly": false, |
|||
"items": [ |
|||
"Drachenzahn", |
|||
"Drachenhaut" |
|||
] |
|||
}, |
|||
{ |
|||
"name": "Mumie", |
|||
"hp": 40, |
|||
"damage": "12", |
|||
"isFriendly": false, |
|||
"items": [ |
|||
"Knochen" |
|||
] |
|||
} |
|||
] |
@ -0,0 +1,172 @@ |
|||
package org.bitbiome.commands; |
|||
|
|||
import org.bitbiome.classes.Colors; |
|||
import org.bitbiome.classes.TravelEngine; |
|||
import org.bitbiome.entities.Location; |
|||
import org.bitbiome.entities.Mob; |
|||
import org.bitbiome.entities.Player; |
|||
import org.junit.jupiter.api.Test; |
|||
import static org.junit.jupiter.api.Assertions.assertEquals; |
|||
import static org.junit.jupiter.api.Assertions.assertTrue; |
|||
|
|||
|
|||
|
|||
public class MapCommandTest { |
|||
@Test |
|||
public void testWaldMapCommand() { |
|||
Player Test = new Player("name"); |
|||
TravelEngine outputtest = new TravelEngine(Test); |
|||
Location Wald = outputtest.getLocationByName("Wald"); |
|||
outputtest.travelTo(Wald); |
|||
String mapMessage = MapCommand.getMapMessage(outputtest); |
|||
StringBuilder outputMessage = new StringBuilder(); |
|||
outputMessage |
|||
.append("Du befindest dich gerade hier: " + Colors.ANSI_GREEN + "Wald" + "\n" + Colors.ANSI_RESET + "Zu den " + Colors.ANSI_BLUE + "blau " + Colors.ANSI_RESET + "markierten Standorten kannst du reisen\n\n") |
|||
.append("Deine Karte:\n\n") |
|||
.append(" __________________________________________________________________________________________________\n") |
|||
.append("| | | |\n") |
|||
.append("| | | |\n") |
|||
.append("| " + Colors.ANSI_BRIGHT_BLACK + "Wueste" + Colors.ANSI_RESET + " | " + Colors.ANSI_BLUE + "Gruenland" + Colors.ANSI_RESET + " | " + Colors.ANSI_BRIGHT_BLACK + "Winterland" + Colors.ANSI_RESET + " |" + "\n") |
|||
.append("| | | |\n") |
|||
.append("|________________________________|________________________________|________________________________|\n") |
|||
.append("| | | |\n") |
|||
.append("| | | |\n") |
|||
.append("| " + Colors.ANSI_BLUE + "Strand" + Colors.ANSI_RESET + " | " + Colors.ANSI_GREEN + "Wald" + Colors.ANSI_RESET + " | " + Colors.ANSI_BLUE + "Berge" + Colors.ANSI_RESET + " |" + "\n") |
|||
.append("| | | |\n") |
|||
.append("|________________________________|________________________________|________________________________|\n"); |
|||
|
|||
|
|||
assertEquals(outputMessage.toString(), mapMessage); |
|||
} |
|||
@Test |
|||
public void testStrandMapCommand() { |
|||
Player Test = new Player("name"); |
|||
TravelEngine outputtest = new TravelEngine(Test); |
|||
Location Strand = outputtest.getLocationByName("Strand"); |
|||
outputtest.travelTo(Strand); |
|||
String mapMessage = MapCommand.getMapMessage(outputtest); |
|||
StringBuilder outputMessage = new StringBuilder(); |
|||
outputMessage |
|||
.append("Du befindest dich gerade hier: " + Colors.ANSI_GREEN + "Strand" + "\n" + Colors.ANSI_RESET + "Zu den " + Colors.ANSI_BLUE + "blau " + Colors.ANSI_RESET + "markierten Standorten kannst du reisen\n\n") |
|||
.append("Deine Karte:\n\n") |
|||
.append(" __________________________________________________________________________________________________\n") |
|||
.append("| | | |\n") |
|||
.append("| | | |\n") |
|||
.append("| " + Colors.ANSI_BLUE + "Wueste" + Colors.ANSI_RESET + " | " + Colors.ANSI_BRIGHT_BLACK + "Gruenland" + Colors.ANSI_RESET + " | " + Colors.ANSI_BRIGHT_BLACK + "Winterland" + Colors.ANSI_RESET + " |" + "\n") |
|||
.append("| | | |\n") |
|||
.append("|________________________________|________________________________|________________________________|\n") |
|||
.append("| | | |\n") |
|||
.append("| | | |\n") |
|||
.append("| " + Colors.ANSI_GREEN + "Strand" + Colors.ANSI_RESET + " | " + Colors.ANSI_BLUE + "Wald" + Colors.ANSI_RESET + " | " + Colors.ANSI_BRIGHT_BLACK + "Berge" + Colors.ANSI_RESET + " |" + "\n") |
|||
.append("| | | |\n") |
|||
.append("|________________________________|________________________________|________________________________|\n"); |
|||
|
|||
|
|||
assertEquals(outputMessage.toString(), mapMessage); |
|||
} |
|||
@Test |
|||
public void testBergeMapCommand() { |
|||
Player Test = new Player("name"); |
|||
TravelEngine outputtest = new TravelEngine(Test); |
|||
Location Berge = outputtest.getLocationByName("Berge"); |
|||
outputtest.travelTo(Berge); |
|||
String mapMessage = MapCommand.getMapMessage(outputtest); |
|||
StringBuilder outputMessage = new StringBuilder(); |
|||
outputMessage |
|||
.append("Du befindest dich gerade hier: " + Colors.ANSI_GREEN + "Berge" + "\n" + Colors.ANSI_RESET + "Zu den " + Colors.ANSI_BLUE + "blau " + Colors.ANSI_RESET + "markierten Standorten kannst du reisen\n\n") |
|||
.append("Deine Karte:\n\n") |
|||
.append(" __________________________________________________________________________________________________\n") |
|||
.append("| | | |\n") |
|||
.append("| | | |\n") |
|||
.append("| " + Colors.ANSI_BRIGHT_BLACK + "Wueste" + Colors.ANSI_RESET + " | " + Colors.ANSI_BRIGHT_BLACK + "Gruenland" + Colors.ANSI_RESET + " | " + Colors.ANSI_BLUE + "Winterland" + Colors.ANSI_RESET + " |" + "\n") |
|||
.append("| | | |\n") |
|||
.append("|________________________________|________________________________|________________________________|\n") |
|||
.append("| | | |\n") |
|||
.append("| | | |\n") |
|||
.append("| " + Colors.ANSI_BRIGHT_BLACK + "Strand" + Colors.ANSI_RESET + " | " + Colors.ANSI_BLUE + "Wald" + Colors.ANSI_RESET + " | " + Colors.ANSI_GREEN + "Berge" + Colors.ANSI_RESET + " |" + "\n") |
|||
.append("| | | |\n") |
|||
.append("|________________________________|________________________________|________________________________|\n"); |
|||
|
|||
|
|||
assertEquals(outputMessage.toString(), mapMessage); |
|||
} |
|||
@Test |
|||
public void testWuesteMapCommand() { |
|||
Player Test = new Player("name"); |
|||
TravelEngine outputtest = new TravelEngine(Test); |
|||
Location Wueste = outputtest.getLocationByName("Wueste"); |
|||
outputtest.travelTo(Wueste); |
|||
String mapMessage = MapCommand.getMapMessage(outputtest); |
|||
StringBuilder outputMessage = new StringBuilder(); |
|||
outputMessage |
|||
.append("Du befindest dich gerade hier: " + Colors.ANSI_GREEN + "Wueste" + "\n" + Colors.ANSI_RESET + "Zu den " + Colors.ANSI_BLUE + "blau " + Colors.ANSI_RESET + "markierten Standorten kannst du reisen\n\n") |
|||
.append("Deine Karte:\n\n") |
|||
.append(" __________________________________________________________________________________________________\n") |
|||
.append("| | | |\n") |
|||
.append("| | | |\n") |
|||
.append("| " + Colors.ANSI_GREEN + "Wueste" + Colors.ANSI_RESET + " | " + Colors.ANSI_BLUE + "Gruenland" + Colors.ANSI_RESET + " | " + Colors.ANSI_BRIGHT_BLACK + "Winterland" + Colors.ANSI_RESET + " |" + "\n") |
|||
.append("| | | |\n") |
|||
.append("|________________________________|________________________________|________________________________|\n") |
|||
.append("| | | |\n") |
|||
.append("| | | |\n") |
|||
.append("| " + Colors.ANSI_BLUE + "Strand" + Colors.ANSI_RESET + " | " + Colors.ANSI_BRIGHT_BLACK + "Wald" + Colors.ANSI_RESET + " | " + Colors.ANSI_BRIGHT_BLACK + "Berge" + Colors.ANSI_RESET + " |" + "\n") |
|||
.append("| | | |\n") |
|||
.append("|________________________________|________________________________|________________________________|\n"); |
|||
|
|||
|
|||
assertEquals(outputMessage.toString(), mapMessage); |
|||
} |
|||
@Test |
|||
public void testGruenlandMapCommand() { |
|||
Player Test = new Player("name"); |
|||
TravelEngine outputtest = new TravelEngine(Test); |
|||
Location Gruenland = outputtest.getLocationByName("Gruenland"); |
|||
outputtest.travelTo(Gruenland); |
|||
String mapMessage = MapCommand.getMapMessage(outputtest); |
|||
StringBuilder outputMessage = new StringBuilder(); |
|||
outputMessage |
|||
.append("Du befindest dich gerade hier: " + Colors.ANSI_GREEN + "Gruenland" + "\n" + Colors.ANSI_RESET + "Zu den " + Colors.ANSI_BLUE + "blau " + Colors.ANSI_RESET + "markierten Standorten kannst du reisen\n\n") |
|||
.append("Deine Karte:\n\n") |
|||
.append(" __________________________________________________________________________________________________\n") |
|||
.append("| | | |\n") |
|||
.append("| | | |\n") |
|||
.append("| " + Colors.ANSI_BLUE + "Wueste" + Colors.ANSI_RESET + " | " + Colors.ANSI_GREEN + "Gruenland" + Colors.ANSI_RESET + " | " + Colors.ANSI_BLUE + "Winterland" + Colors.ANSI_RESET + " |" + "\n") |
|||
.append("| | | |\n") |
|||
.append("|________________________________|________________________________|________________________________|\n") |
|||
.append("| | | |\n") |
|||
.append("| | | |\n") |
|||
.append("| " + Colors.ANSI_BRIGHT_BLACK + "Strand" + Colors.ANSI_RESET + " | " + Colors.ANSI_BLUE + "Wald" + Colors.ANSI_RESET + " | " + Colors.ANSI_BRIGHT_BLACK + "Berge" + Colors.ANSI_RESET + " |" + "\n") |
|||
.append("| | | |\n") |
|||
.append("|________________________________|________________________________|________________________________|\n"); |
|||
|
|||
|
|||
assertEquals(outputMessage.toString(), mapMessage); |
|||
} |
|||
@Test |
|||
public void testWinterlandMapCommand() { |
|||
Player Test = new Player("name"); |
|||
TravelEngine outputtest = new TravelEngine(Test); |
|||
Location Winterland = outputtest.getLocationByName("Winterland"); |
|||
outputtest.travelTo(Winterland); |
|||
String mapMessage = MapCommand.getMapMessage(outputtest); |
|||
StringBuilder outputMessage = new StringBuilder(); |
|||
outputMessage |
|||
.append("Du befindest dich gerade hier: " + Colors.ANSI_GREEN + "Winterland" + "\n" + Colors.ANSI_RESET + "Zu den " + Colors.ANSI_BLUE + "blau " + Colors.ANSI_RESET + "markierten Standorten kannst du reisen\n\n") |
|||
.append("Deine Karte:\n\n") |
|||
.append(" __________________________________________________________________________________________________\n") |
|||
.append("| | | |\n") |
|||
.append("| | | |\n") |
|||
.append("| " + Colors.ANSI_BRIGHT_BLACK + "Wueste" + Colors.ANSI_RESET + " | " + Colors.ANSI_BLUE + "Gruenland" + Colors.ANSI_RESET + " | " + Colors.ANSI_GREEN + "Winterland" + Colors.ANSI_RESET + " |" + "\n") |
|||
.append("| | | |\n") |
|||
.append("|________________________________|________________________________|________________________________|\n") |
|||
.append("| | | |\n") |
|||
.append("| | | |\n") |
|||
.append("| " + Colors.ANSI_BRIGHT_BLACK + "Strand" + Colors.ANSI_RESET + " | " + Colors.ANSI_BRIGHT_BLACK + "Wald" + Colors.ANSI_RESET + " | " + Colors.ANSI_BLUE + "Berge" + Colors.ANSI_RESET + " |" + "\n") |
|||
.append("| | | |\n") |
|||
.append("|________________________________|________________________________|________________________________|\n"); |
|||
|
|||
|
|||
assertEquals(outputMessage.toString(), mapMessage); |
|||
} |
|||
} |
|||
|
Write
Preview
Loading…
Cancel
Save
Reference in new issue