From b3dfbe360189c4ced486e25ebbfe3c7a0f4f52a9 Mon Sep 17 00:00:00 2001 From: David Hermann Date: Thu, 5 Jan 2023 21:20:24 +0100 Subject: [PATCH] refactor: outsourced code in String function --- src/main/java/org/bitbiome/commands/QuitCommand.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/bitbiome/commands/QuitCommand.java b/src/main/java/org/bitbiome/commands/QuitCommand.java index 13e4e1e..d969852 100644 --- a/src/main/java/org/bitbiome/commands/QuitCommand.java +++ b/src/main/java/org/bitbiome/commands/QuitCommand.java @@ -6,7 +6,11 @@ public class QuitCommand implements CommandAPI { @Override public void performCommand(Scanner scanner, boolean isRunning, String message) { - System.out.println("You quitted!"); + System.out.println(getQuitMessage()); System.exit(0); } + + public static String getQuitMessage() { + return "You quitted!"; + } }