From c18cb6190aa674351719c81b4e51e9deebc97be4 Mon Sep 17 00:00:00 2001 From: David Hermann Date: Wed, 18 Jan 2023 19:52:22 +0100 Subject: [PATCH] refactoring: outsourced current location message --- src/main/java/org/bitbiome/commands/LocationCommand.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/bitbiome/commands/LocationCommand.java b/src/main/java/org/bitbiome/commands/LocationCommand.java index 5b690d0..cbbca02 100644 --- a/src/main/java/org/bitbiome/commands/LocationCommand.java +++ b/src/main/java/org/bitbiome/commands/LocationCommand.java @@ -8,6 +8,11 @@ public class LocationCommand implements CommandAPI{ @Override public void performCommand(Scanner scanner, boolean isRunning, String message, TravelEngine travelEngine) { - System.out.println("Du befindest dich gerade hier: " + travelEngine.getPlayer().getLocation().getName()); + System.out.println(getLocationMessage(travelEngine)); + } + + + public static String getLocationMessage(TravelEngine travelEngine) { + return "Du befindest dich gerade hier: " + travelEngine.getPlayer().getLocation().getName(); } }