From bf45a594055377a5987cc495ffe0824259a4303f Mon Sep 17 00:00:00 2001 From: Friederike von Gruben Date: Mon, 6 Feb 2023 13:54:47 +0100 Subject: [PATCH] Created BlackJackCommand and added to the CommandListener --- .../java/org/bitbiome/commands/BlackJackCommand.java | 12 ++++++++++++ .../java/org/bitbiome/commands/CommandListener.java | 1 + 2 files changed, 13 insertions(+) create mode 100644 src/main/java/org/bitbiome/commands/BlackJackCommand.java diff --git a/src/main/java/org/bitbiome/commands/BlackJackCommand.java b/src/main/java/org/bitbiome/commands/BlackJackCommand.java new file mode 100644 index 0000000..734f6b6 --- /dev/null +++ b/src/main/java/org/bitbiome/commands/BlackJackCommand.java @@ -0,0 +1,12 @@ +package org.bitbiome.commands; + + +import java.util.Scanner; + +public class BlackJackCommand implements CommandAPI { + + @Override + public void performCommand(Scanner scanner, boolean isRunning, String message) { + System.out.println("Du hast das Spiel BlackJack gestartet. Die Spielregeln lauten wie folgt: Du und dein Gegner bekommen jede Runde Zahlen von 4 - 11. \nDerjenige, der zuerst 21 Punkte hat gewinnt. Derjenige, der über 21 Punkte hat verliert. Möchte keiner mehr Karten ziehen, gewinnt der mit dem höchsten Blatt!\n"); + } +} \ No newline at end of file diff --git a/src/main/java/org/bitbiome/commands/CommandListener.java b/src/main/java/org/bitbiome/commands/CommandListener.java index 6465891..ebc7dbc 100644 --- a/src/main/java/org/bitbiome/commands/CommandListener.java +++ b/src/main/java/org/bitbiome/commands/CommandListener.java @@ -15,6 +15,7 @@ public class CommandListener { commands.put("exit", new QuitCommand()); commands.put("quit", new QuitCommand()); commands.put("quiz", new QuizCommand()); + commands.put("blackjack", new BlackJackCommand()); } public HashMap returnCommands() {