From 8e7fbfb26cb57d568b644d8d93cb3b4c9cd83016 Mon Sep 17 00:00:00 2001 From: Max Gerbeth Date: Mon, 9 Jan 2023 10:25:26 +0100 Subject: [PATCH 001/152] Added Shop.java --- src/main/java/org/bitbiome/Shop.java | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 src/main/java/org/bitbiome/Shop.java diff --git a/src/main/java/org/bitbiome/Shop.java b/src/main/java/org/bitbiome/Shop.java new file mode 100644 index 0000000..282bc02 --- /dev/null +++ b/src/main/java/org/bitbiome/Shop.java @@ -0,0 +1,7 @@ +package org.bitbiome; + +public class Shop { + public Shop(){ + + } +} From cfa4e9de4e5d62902b539f99feb677142a60fe26 Mon Sep 17 00:00:00 2001 From: Max Gerbeth Date: Mon, 9 Jan 2023 10:29:24 +0100 Subject: [PATCH 002/152] Added ShopCommand.java --- src/main/java/org/bitbiome/commands/ShopCommand.java | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 src/main/java/org/bitbiome/commands/ShopCommand.java diff --git a/src/main/java/org/bitbiome/commands/ShopCommand.java b/src/main/java/org/bitbiome/commands/ShopCommand.java new file mode 100644 index 0000000..2167bd6 --- /dev/null +++ b/src/main/java/org/bitbiome/commands/ShopCommand.java @@ -0,0 +1,11 @@ +package org.bitbiome.commands; + +import java.util.Scanner; + +public class ShopCommand implements CommandAPI{ + + @Override + public void performCommand(Scanner scanner, boolean isRunning, String message) { + + } +} From e361f4f2b9bd257ebf5107ae67cf41599187416e Mon Sep 17 00:00:00 2001 From: Max Gerbeth Date: Mon, 9 Jan 2023 10:33:49 +0100 Subject: [PATCH 003/152] Shop command integration --- src/main/java/org/bitbiome/commands/CommandListener.java | 2 ++ src/main/java/org/bitbiome/commands/ShopCommand.java | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/bitbiome/commands/CommandListener.java b/src/main/java/org/bitbiome/commands/CommandListener.java index 2e62105..0b4f4dc 100644 --- a/src/main/java/org/bitbiome/commands/CommandListener.java +++ b/src/main/java/org/bitbiome/commands/CommandListener.java @@ -14,6 +14,8 @@ public class CommandListener { commands.put("exit", new QuitCommand()); commands.put("quit", new QuitCommand()); + + commands.put("shop", new ShopCommand()); } public HashMap returnCommands() { diff --git a/src/main/java/org/bitbiome/commands/ShopCommand.java b/src/main/java/org/bitbiome/commands/ShopCommand.java index 2167bd6..2bc5d15 100644 --- a/src/main/java/org/bitbiome/commands/ShopCommand.java +++ b/src/main/java/org/bitbiome/commands/ShopCommand.java @@ -6,6 +6,8 @@ public class ShopCommand implements CommandAPI{ @Override public void performCommand(Scanner scanner, boolean isRunning, String message) { - + System.out.println("Willkommen im Shop!"); } + + } From d5bf6ba5fe072f56d3b013d8003fbad4e9f22104 Mon Sep 17 00:00:00 2001 From: Max Gerbeth Date: Mon, 9 Jan 2023 10:49:57 +0100 Subject: [PATCH 004/152] Added Item.java --- src/main/java/org/bitbiome/shop/Item.java | 7 +++++++ src/main/java/org/bitbiome/{ => shop}/Shop.java | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 src/main/java/org/bitbiome/shop/Item.java rename src/main/java/org/bitbiome/{ => shop}/Shop.java (64%) diff --git a/src/main/java/org/bitbiome/shop/Item.java b/src/main/java/org/bitbiome/shop/Item.java new file mode 100644 index 0000000..ffdca21 --- /dev/null +++ b/src/main/java/org/bitbiome/shop/Item.java @@ -0,0 +1,7 @@ +package org.bitbiome.shop; + +public class Item { + public Item(){ + + } +} diff --git a/src/main/java/org/bitbiome/Shop.java b/src/main/java/org/bitbiome/shop/Shop.java similarity index 64% rename from src/main/java/org/bitbiome/Shop.java rename to src/main/java/org/bitbiome/shop/Shop.java index 282bc02..88aa98a 100644 --- a/src/main/java/org/bitbiome/Shop.java +++ b/src/main/java/org/bitbiome/shop/Shop.java @@ -1,4 +1,4 @@ -package org.bitbiome; +package org.bitbiome.shop; public class Shop { public Shop(){ From 31aea13df574e525fb44d7732348e1b0f7adbebe Mon Sep 17 00:00:00 2001 From: Max Gerbeth Date: Mon, 9 Jan 2023 16:50:23 +0100 Subject: [PATCH 005/152] Constructor in Item.java --- src/main/java/org/bitbiome/shop/Item.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/bitbiome/shop/Item.java b/src/main/java/org/bitbiome/shop/Item.java index ffdca21..f725bbe 100644 --- a/src/main/java/org/bitbiome/shop/Item.java +++ b/src/main/java/org/bitbiome/shop/Item.java @@ -1,7 +1,16 @@ package org.bitbiome.shop; public class Item { - public Item(){ + public String name; + public String damage; + public boolean crafting; + public int durability; + public Item(String name, String damage, boolean crafting, int durability){ + this.name = name; + this.damage = damage; + this.crafting = crafting; + this.durability = durability; } -} + +} \ No newline at end of file From a8e21e70e7b6271766e65695ddfb7964b6c167e4 Mon Sep 17 00:00:00 2001 From: Max Gerbeth Date: Mon, 9 Jan 2023 16:52:16 +0100 Subject: [PATCH 006/152] get and set Methods in Item.java --- src/main/java/org/bitbiome/shop/Item.java | 31 +++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/src/main/java/org/bitbiome/shop/Item.java b/src/main/java/org/bitbiome/shop/Item.java index f725bbe..96aa197 100644 --- a/src/main/java/org/bitbiome/shop/Item.java +++ b/src/main/java/org/bitbiome/shop/Item.java @@ -13,4 +13,35 @@ public class Item { this.durability = durability; } + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getDamage() { + return damage; + } + + public void setDamage(String damage) { + this.damage = damage; + } + + public boolean isCrafting() { + return crafting; + } + + public void setCrafting(boolean crafting) { + this.crafting = crafting; + } + + public int getDurability() { + return durability; + } + + public void setDurability(int durability) { + this.durability = durability; + } } \ No newline at end of file From 19f227ebe83ac4775133550f7b07ae99155fa95e Mon Sep 17 00:00:00 2001 From: Max Gerbeth Date: Mon, 9 Jan 2023 17:01:10 +0100 Subject: [PATCH 007/152] Method headers added to Items.java --- src/main/java/org/bitbiome/shop/Shop.java | 28 +++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/main/java/org/bitbiome/shop/Shop.java b/src/main/java/org/bitbiome/shop/Shop.java index 88aa98a..2bdab64 100644 --- a/src/main/java/org/bitbiome/shop/Shop.java +++ b/src/main/java/org/bitbiome/shop/Shop.java @@ -1,7 +1,35 @@ package org.bitbiome.shop; +import java.util.ArrayList; + public class Shop { public Shop(){ } + + public boolean kaufen(){ + //ToDo + + return true; + } + + private ArrayList itemsLaden(){ + //ToDo + + return null; + } + + public ArrayList itemRotation(ArrayList alleItems, int anzahlItemsImShop){ + //ToDo + + return null; + } + + public ArrayList aktuellImShop(){ + return null; + } + + public void Quiz(){ + //ToDo + } } From d7fb342d9b6d09d9835cb17c759779e5d4a4d03c Mon Sep 17 00:00:00 2001 From: Max Gerbeth Date: Mon, 9 Jan 2023 17:11:16 +0100 Subject: [PATCH 008/152] refactoring: getCurrentShopItems() --- src/main/java/org/bitbiome/shop/Shop.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/bitbiome/shop/Shop.java b/src/main/java/org/bitbiome/shop/Shop.java index 2bdab64..07f519e 100644 --- a/src/main/java/org/bitbiome/shop/Shop.java +++ b/src/main/java/org/bitbiome/shop/Shop.java @@ -25,7 +25,7 @@ public class Shop { return null; } - public ArrayList aktuellImShop(){ + public ArrayList getCurrentShopItems(){ return null; } From 625d1ea2c27dbcebfcd8836e053fb51ba8d7bb61 Mon Sep 17 00:00:00 2001 From: Max Gerbeth Date: Mon, 9 Jan 2023 17:14:06 +0100 Subject: [PATCH 009/152] refactoring: buy(), loadItems(), getCurrentShopItems(), quiz() --- src/main/java/org/bitbiome/shop/Shop.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/bitbiome/shop/Shop.java b/src/main/java/org/bitbiome/shop/Shop.java index 07f519e..ecc2051 100644 --- a/src/main/java/org/bitbiome/shop/Shop.java +++ b/src/main/java/org/bitbiome/shop/Shop.java @@ -3,17 +3,20 @@ package org.bitbiome.shop; import java.util.ArrayList; public class Shop { + public ArrayList allItems; + public ArrayList currentShopItems; + public Shop(){ } - public boolean kaufen(){ + public boolean buy(){ //ToDo return true; } - private ArrayList itemsLaden(){ + private ArrayList loadItems(){ //ToDo return null; @@ -26,10 +29,10 @@ public class Shop { } public ArrayList getCurrentShopItems(){ - return null; + return currentShopItems; } - public void Quiz(){ + public void quiz(){ //ToDo } } From 49bd7cb2c6f1771023a3f5aacff2fca58f65e299 Mon Sep 17 00:00:00 2001 From: Max Gerbeth Date: Mon, 9 Jan 2023 17:26:58 +0100 Subject: [PATCH 010/152] Added Method printArrayList() --- src/main/java/org/bitbiome/commands/ShopCommand.java | 4 +++- src/main/java/org/bitbiome/shop/Shop.java | 10 +++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/bitbiome/commands/ShopCommand.java b/src/main/java/org/bitbiome/commands/ShopCommand.java index 2bc5d15..9d5c950 100644 --- a/src/main/java/org/bitbiome/commands/ShopCommand.java +++ b/src/main/java/org/bitbiome/commands/ShopCommand.java @@ -1,12 +1,14 @@ package org.bitbiome.commands; +import org.bitbiome.shop.Shop; + import java.util.Scanner; public class ShopCommand implements CommandAPI{ @Override public void performCommand(Scanner scanner, boolean isRunning, String message) { - System.out.println("Willkommen im Shop!"); + new Shop(); } diff --git a/src/main/java/org/bitbiome/shop/Shop.java b/src/main/java/org/bitbiome/shop/Shop.java index ecc2051..aa4cf9a 100644 --- a/src/main/java/org/bitbiome/shop/Shop.java +++ b/src/main/java/org/bitbiome/shop/Shop.java @@ -7,7 +7,7 @@ public class Shop { public ArrayList currentShopItems; public Shop(){ - + allItems = loadItems(); } public boolean buy(){ @@ -35,4 +35,12 @@ public class Shop { public void quiz(){ //ToDo } + + private void printArrayList(ArrayList arrayList){ + System.out.println(""); + for(int i = 0; i < arrayList.size(); i++){ + System.out.println(arrayList.get(i).getName() + " | " + arrayList.get(i).getDamage() + " | " + arrayList.get(i).isCrafting() + " | " + arrayList.get(i).getDurability()); + } + System.out.println(""); + } } From 6a5a6454f55e6ef99044487ecbfe3eec2e12892d Mon Sep 17 00:00:00 2001 From: Max Gerbeth Date: Mon, 9 Jan 2023 17:32:54 +0100 Subject: [PATCH 011/152] refactoring: Shop.java and Item.java --- src/main/java/org/bitbiome/shop/Item.java | 37 +++++++++-------------- src/main/java/org/bitbiome/shop/Shop.java | 2 +- 2 files changed, 15 insertions(+), 24 deletions(-) diff --git a/src/main/java/org/bitbiome/shop/Item.java b/src/main/java/org/bitbiome/shop/Item.java index 96aa197..c6f9672 100644 --- a/src/main/java/org/bitbiome/shop/Item.java +++ b/src/main/java/org/bitbiome/shop/Item.java @@ -2,15 +2,14 @@ package org.bitbiome.shop; public class Item { public String name; - public String damage; - public boolean crafting; - public int durability; + public int amount; + public int gold; - public Item(String name, String damage, boolean crafting, int durability){ + + public Item(String name, int amount, int gold){ this.name = name; - this.damage = damage; - this.crafting = crafting; - this.durability = durability; + this.amount = amount; + this.gold = gold; } public String getName() { @@ -21,27 +20,19 @@ public class Item { this.name = name; } - public String getDamage() { - return damage; - } - - public void setDamage(String damage) { - this.damage = damage; - } - - public boolean isCrafting() { - return crafting; + public int getAmount() { + return amount; } - public void setCrafting(boolean crafting) { - this.crafting = crafting; + public void setAmount(int amount) { + this.amount = amount; } - public int getDurability() { - return durability; + public int getGold() { + return gold; } - public void setDurability(int durability) { - this.durability = durability; + public void setGold(int gold) { + this.gold = gold; } } \ No newline at end of file diff --git a/src/main/java/org/bitbiome/shop/Shop.java b/src/main/java/org/bitbiome/shop/Shop.java index aa4cf9a..f797073 100644 --- a/src/main/java/org/bitbiome/shop/Shop.java +++ b/src/main/java/org/bitbiome/shop/Shop.java @@ -39,7 +39,7 @@ public class Shop { private void printArrayList(ArrayList arrayList){ System.out.println(""); for(int i = 0; i < arrayList.size(); i++){ - System.out.println(arrayList.get(i).getName() + " | " + arrayList.get(i).getDamage() + " | " + arrayList.get(i).isCrafting() + " | " + arrayList.get(i).getDurability()); + System.out.println(arrayList.get(i).getName() + " | " + arrayList.get(i).getAmount() + " | " + arrayList.get(i).getGold()); } System.out.println(""); } From e96926dba3d8d30d2f37675e8b98f10f52455279 Mon Sep 17 00:00:00 2001 From: Max Gerbeth Date: Mon, 9 Jan 2023 17:35:32 +0100 Subject: [PATCH 012/152] refactoring: itemRotation() --- src/main/java/org/bitbiome/shop/Shop.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/bitbiome/shop/Shop.java b/src/main/java/org/bitbiome/shop/Shop.java index f797073..83d33ef 100644 --- a/src/main/java/org/bitbiome/shop/Shop.java +++ b/src/main/java/org/bitbiome/shop/Shop.java @@ -22,7 +22,7 @@ public class Shop { return null; } - public ArrayList itemRotation(ArrayList alleItems, int anzahlItemsImShop){ + public ArrayList itemRotation(ArrayList alleItems, int itemCount){ //ToDo return null; From f51c508b2554d9d96a60929a0151482f6c7721c0 Mon Sep 17 00:00:00 2001 From: Max Gerbeth Date: Mon, 9 Jan 2023 18:19:56 +0100 Subject: [PATCH 013/152] while input loop and validInput() method --- .../org/bitbiome/commands/ShopCommand.java | 29 ++++++++++++++++++- src/main/java/org/bitbiome/shop/Shop.java | 14 ++++++--- 2 files changed, 38 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/bitbiome/commands/ShopCommand.java b/src/main/java/org/bitbiome/commands/ShopCommand.java index 9d5c950..3cc6337 100644 --- a/src/main/java/org/bitbiome/commands/ShopCommand.java +++ b/src/main/java/org/bitbiome/commands/ShopCommand.java @@ -5,11 +5,38 @@ import org.bitbiome.shop.Shop; import java.util.Scanner; public class ShopCommand implements CommandAPI{ + Shop shop = new Shop(); @Override public void performCommand(Scanner scanner, boolean isRunning, String message) { - new Shop(); + System.out.println("Willkommen im Shop!"); + System.out.println("Folgende Items sind aktuell im Shop:"); + shop.getCurrentShopItems(); + System.out.println("Was willst Du hier im Shop?"); + System.out.println("Etwas kaufen: 1"); + System.out.println("Das Quiz spielen: 2"); + System.out.println("Den Shop verlassen: 3"); + + while (true){ + String input = scanner.nextLine(); + + if(validInput(input)){ + if(input.equals("1")){ + //shop.buy(); + } else if(input.equals("2")){ + //shop.quiz() + } else if(input.equals("3")){ + System.out.println("Der Shop wurde verlassen!"); + break; + } + }else { + System.out.println("Unbekannte Eingabe!"); + } + } } + private boolean validInput(String input){ + return (input.equals("1") || input.equals("2") || input.equals("3")); + } } diff --git a/src/main/java/org/bitbiome/shop/Shop.java b/src/main/java/org/bitbiome/shop/Shop.java index 83d33ef..193e0ee 100644 --- a/src/main/java/org/bitbiome/shop/Shop.java +++ b/src/main/java/org/bitbiome/shop/Shop.java @@ -7,7 +7,13 @@ public class Shop { public ArrayList currentShopItems; public Shop(){ - allItems = loadItems(); + //allItems = loadItems(); + allItems = new ArrayList(); + allItems.add(new Item("Holz", 10, 10)); + allItems.add(new Item("Holz2", 11, 10)); + allItems.add(new Item("Holz3", 12, 10)); + allItems.add(new Item("Holz4", 13, 10)); + //currentShopItems = itemRotation(allItems, 3); } public boolean buy(){ @@ -28,8 +34,8 @@ public class Shop { return null; } - public ArrayList getCurrentShopItems(){ - return currentShopItems; + public void getCurrentShopItems(){ + printArrayList(allItems); } public void quiz(){ @@ -39,7 +45,7 @@ public class Shop { private void printArrayList(ArrayList arrayList){ System.out.println(""); for(int i = 0; i < arrayList.size(); i++){ - System.out.println(arrayList.get(i).getName() + " | " + arrayList.get(i).getAmount() + " | " + arrayList.get(i).getGold()); + System.out.println(arrayList.get(i).getName() + " | Anzahl: " + arrayList.get(i).getAmount() + " | Kosten: " + arrayList.get(i).getGold()); } System.out.println(""); } From 148b7f0927f285db956d928b83e760b53f696882 Mon Sep 17 00:00:00 2001 From: Max Gerbeth Date: Mon, 9 Jan 2023 18:33:14 +0100 Subject: [PATCH 014/152] unittest: ShopCommandTest.java --- .../java/org/bitbiome/commands/ShopCommand.java | 2 +- .../org/bitbiome/commands/ShopCommandTest.java | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 src/test/java/org/bitbiome/commands/ShopCommandTest.java diff --git a/src/main/java/org/bitbiome/commands/ShopCommand.java b/src/main/java/org/bitbiome/commands/ShopCommand.java index 3cc6337..1231a48 100644 --- a/src/main/java/org/bitbiome/commands/ShopCommand.java +++ b/src/main/java/org/bitbiome/commands/ShopCommand.java @@ -35,7 +35,7 @@ public class ShopCommand implements CommandAPI{ } } - private boolean validInput(String input){ + public static boolean validInput(String input){ return (input.equals("1") || input.equals("2") || input.equals("3")); } diff --git a/src/test/java/org/bitbiome/commands/ShopCommandTest.java b/src/test/java/org/bitbiome/commands/ShopCommandTest.java new file mode 100644 index 0000000..449fc23 --- /dev/null +++ b/src/test/java/org/bitbiome/commands/ShopCommandTest.java @@ -0,0 +1,16 @@ +package org.bitbiome.commands; + +import org.bitbiome.shop.Shop; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +public class ShopCommandTest { + final ShopCommand shopCommand = new ShopCommand(); + @Test + public void testValidInput(){ + boolean expected = true; + boolean result = shopCommand.validInput("1"); + assertEquals(expected, result); + } +} From e568ffa523590ab08f7cb83416d3f63550cb732c Mon Sep 17 00:00:00 2001 From: Max Gerbeth Date: Wed, 11 Jan 2023 09:52:14 +0100 Subject: [PATCH 015/152] implements loadItems() --- src/main/java/org/bitbiome/shop/Shop.java | 31 ++++++++++++++++------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/src/main/java/org/bitbiome/shop/Shop.java b/src/main/java/org/bitbiome/shop/Shop.java index 193e0ee..20bff8a 100644 --- a/src/main/java/org/bitbiome/shop/Shop.java +++ b/src/main/java/org/bitbiome/shop/Shop.java @@ -1,5 +1,11 @@ package org.bitbiome.shop; +import org.json.JSONArray; +import org.json.JSONObject; + +import java.io.File; +import java.nio.file.Files; +import java.nio.file.Paths; import java.util.ArrayList; public class Shop { @@ -7,13 +13,7 @@ public class Shop { public ArrayList currentShopItems; public Shop(){ - //allItems = loadItems(); - allItems = new ArrayList(); - allItems.add(new Item("Holz", 10, 10)); - allItems.add(new Item("Holz2", 11, 10)); - allItems.add(new Item("Holz3", 12, 10)); - allItems.add(new Item("Holz4", 13, 10)); - //currentShopItems = itemRotation(allItems, 3); + allItems = loadItems(); } public boolean buy(){ @@ -23,9 +23,22 @@ public class Shop { } private ArrayList loadItems(){ - //ToDo + File file = new File("src/main/resources/gameconfig.json"); + ArrayList arrayList = new ArrayList(); + try { + String content = new String(Files.readAllBytes(Paths.get(file.toURI())), "UTF-8"); + JSONObject jsonObject = new JSONObject(content); - return null; + JSONArray jsonArray = jsonObject.getJSONArray("shopitems"); + for(int i = 0; i < jsonArray.length(); i++){ + JSONObject tempJSON = jsonArray.getJSONObject(i); + arrayList.add(new Item(tempJSON.getString("name"), tempJSON.getInt("amount"), tempJSON.getInt("gold"))); + } + }catch (Exception e){ + e.printStackTrace(); + } + + return arrayList; } public ArrayList itemRotation(ArrayList alleItems, int itemCount){ From 4a8ebd9166f448b7cc01ad961c715b59333bf027 Mon Sep 17 00:00:00 2001 From: Max Gerbeth Date: Wed, 11 Jan 2023 09:57:11 +0100 Subject: [PATCH 016/152] refactoring: printArrayList() in Shop.java --- src/main/java/org/bitbiome/shop/Shop.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/bitbiome/shop/Shop.java b/src/main/java/org/bitbiome/shop/Shop.java index 20bff8a..d47a2a3 100644 --- a/src/main/java/org/bitbiome/shop/Shop.java +++ b/src/main/java/org/bitbiome/shop/Shop.java @@ -58,7 +58,9 @@ public class Shop { private void printArrayList(ArrayList arrayList){ System.out.println(""); for(int i = 0; i < arrayList.size(); i++){ - System.out.println(arrayList.get(i).getName() + " | Anzahl: " + arrayList.get(i).getAmount() + " | Kosten: " + arrayList.get(i).getGold()); + if(arrayList.get(i).getAmount() != 0) { + System.out.println(arrayList.get(i).getName() + " | Anzahl: " + arrayList.get(i).getAmount() + " | Kosten: " + arrayList.get(i).getGold()); + } } System.out.println(""); } From 25a0297ec7eb55188e3a0f44c406d23e780a9921 Mon Sep 17 00:00:00 2001 From: Max Gerbeth Date: Wed, 11 Jan 2023 10:07:11 +0100 Subject: [PATCH 017/152] implementing itemRotation() --- src/main/java/org/bitbiome/shop/Shop.java | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/bitbiome/shop/Shop.java b/src/main/java/org/bitbiome/shop/Shop.java index d47a2a3..21aea67 100644 --- a/src/main/java/org/bitbiome/shop/Shop.java +++ b/src/main/java/org/bitbiome/shop/Shop.java @@ -7,6 +7,8 @@ import java.io.File; import java.nio.file.Files; import java.nio.file.Paths; import java.util.ArrayList; +import java.util.HashSet; +import java.util.Random; public class Shop { public ArrayList allItems; @@ -14,6 +16,7 @@ public class Shop { public Shop(){ allItems = loadItems(); + currentShopItems = itemRotation(allItems, 2); } public boolean buy(){ @@ -41,10 +44,18 @@ public class Shop { return arrayList; } - public ArrayList itemRotation(ArrayList alleItems, int itemCount){ - //ToDo - - return null; + public ArrayList itemRotation(ArrayList alleItems, int itemCount){ + ArrayList arrayList = new ArrayList(); + HashSet hashSet = new HashSet<>(); + Random random = new Random(); + while (hashSet.size() < itemCount){ + int rand = random.nextInt(alleItems.size()); + if(!hashSet.contains(rand)){ + hashSet.add(rand); + arrayList.add(alleItems.get(rand)); + } + } + return arrayList; } public void getCurrentShopItems(){ From c7b47c84e4ed57cd1f2d5418204a87cabe75a762 Mon Sep 17 00:00:00 2001 From: Max Gerbeth Date: Wed, 11 Jan 2023 10:09:21 +0100 Subject: [PATCH 018/152] refactoring: printCurrentShopItems() --- src/main/java/org/bitbiome/commands/ShopCommand.java | 2 +- src/main/java/org/bitbiome/shop/Shop.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/bitbiome/commands/ShopCommand.java b/src/main/java/org/bitbiome/commands/ShopCommand.java index 1231a48..357822b 100644 --- a/src/main/java/org/bitbiome/commands/ShopCommand.java +++ b/src/main/java/org/bitbiome/commands/ShopCommand.java @@ -11,7 +11,7 @@ public class ShopCommand implements CommandAPI{ public void performCommand(Scanner scanner, boolean isRunning, String message) { System.out.println("Willkommen im Shop!"); System.out.println("Folgende Items sind aktuell im Shop:"); - shop.getCurrentShopItems(); + shop.printCurrentShopItems(); System.out.println("Was willst Du hier im Shop?"); System.out.println("Etwas kaufen: 1"); System.out.println("Das Quiz spielen: 2"); diff --git a/src/main/java/org/bitbiome/shop/Shop.java b/src/main/java/org/bitbiome/shop/Shop.java index 21aea67..eeb8759 100644 --- a/src/main/java/org/bitbiome/shop/Shop.java +++ b/src/main/java/org/bitbiome/shop/Shop.java @@ -58,8 +58,8 @@ public class Shop { return arrayList; } - public void getCurrentShopItems(){ - printArrayList(allItems); + public void printCurrentShopItems(){ + printArrayList(currentShopItems); } public void quiz(){ From b6f1b1f6d00584a4cb379ee9ad2462209e3cb1b1 Mon Sep 17 00:00:00 2001 From: Max Gerbeth Date: Wed, 11 Jan 2023 10:16:32 +0100 Subject: [PATCH 019/152] refactoring: loadPartofItems() --- src/main/java/org/bitbiome/commands/ShopCommand.java | 1 - src/main/java/org/bitbiome/shop/Shop.java | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/bitbiome/commands/ShopCommand.java b/src/main/java/org/bitbiome/commands/ShopCommand.java index 357822b..2114751 100644 --- a/src/main/java/org/bitbiome/commands/ShopCommand.java +++ b/src/main/java/org/bitbiome/commands/ShopCommand.java @@ -19,7 +19,6 @@ public class ShopCommand implements CommandAPI{ while (true){ String input = scanner.nextLine(); - if(validInput(input)){ if(input.equals("1")){ //shop.buy(); diff --git a/src/main/java/org/bitbiome/shop/Shop.java b/src/main/java/org/bitbiome/shop/Shop.java index eeb8759..ba1f00b 100644 --- a/src/main/java/org/bitbiome/shop/Shop.java +++ b/src/main/java/org/bitbiome/shop/Shop.java @@ -16,7 +16,7 @@ public class Shop { public Shop(){ allItems = loadItems(); - currentShopItems = itemRotation(allItems, 2); + currentShopItems = loadPartofItems(allItems, 2); } public boolean buy(){ @@ -44,7 +44,7 @@ public class Shop { return arrayList; } - public ArrayList itemRotation(ArrayList alleItems, int itemCount){ + public ArrayList loadPartofItems(ArrayList alleItems, int itemCount){ ArrayList arrayList = new ArrayList(); HashSet hashSet = new HashSet<>(); Random random = new Random(); From f32fa1704ffac6a6eac939af7bf6f2758d2fb476 Mon Sep 17 00:00:00 2001 From: Max Gerbeth Date: Wed, 11 Jan 2023 10:17:47 +0100 Subject: [PATCH 020/152] implementing itemRotation() --- src/main/java/org/bitbiome/shop/Shop.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/bitbiome/shop/Shop.java b/src/main/java/org/bitbiome/shop/Shop.java index ba1f00b..6e9fe3b 100644 --- a/src/main/java/org/bitbiome/shop/Shop.java +++ b/src/main/java/org/bitbiome/shop/Shop.java @@ -44,7 +44,7 @@ public class Shop { return arrayList; } - public ArrayList loadPartofItems(ArrayList alleItems, int itemCount){ + private ArrayList loadPartofItems(ArrayList alleItems, int itemCount){ ArrayList arrayList = new ArrayList(); HashSet hashSet = new HashSet<>(); Random random = new Random(); @@ -58,6 +58,10 @@ public class Shop { return arrayList; } + public void itemRotation(){ + currentShopItems = loadPartofItems(allItems, 2); + } + public void printCurrentShopItems(){ printArrayList(currentShopItems); } From 85bcef10ab4b92883ba7997b3276f4ddea8ab863 Mon Sep 17 00:00:00 2001 From: Max Gerbeth Date: Sun, 15 Jan 2023 17:50:04 +0100 Subject: [PATCH 021/152] implementing request for item and amount --- .../org/bitbiome/commands/ShopCommand.java | 43 ++++++++++++++++--- 1 file changed, 38 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/bitbiome/commands/ShopCommand.java b/src/main/java/org/bitbiome/commands/ShopCommand.java index 2114751..369e7a4 100644 --- a/src/main/java/org/bitbiome/commands/ShopCommand.java +++ b/src/main/java/org/bitbiome/commands/ShopCommand.java @@ -1,7 +1,9 @@ package org.bitbiome.commands; +import org.bitbiome.shop.Item; import org.bitbiome.shop.Shop; +import java.util.ArrayList; import java.util.Scanner; public class ShopCommand implements CommandAPI{ @@ -12,16 +14,47 @@ public class ShopCommand implements CommandAPI{ System.out.println("Willkommen im Shop!"); System.out.println("Folgende Items sind aktuell im Shop:"); shop.printCurrentShopItems(); - System.out.println("Was willst Du hier im Shop?"); - System.out.println("Etwas kaufen: 1"); - System.out.println("Das Quiz spielen: 2"); - System.out.println("Den Shop verlassen: 3"); + ArrayList currentItems; while (true){ + System.out.println("Was willst Du hier im Shop?"); + System.out.println("Etwas kaufen: 1"); + System.out.println("Das Quiz spielen: 2"); + System.out.println("Den Shop verlassen: 3"); + String input = scanner.nextLine(); if(validInput(input)){ if(input.equals("1")){ - //shop.buy(); + currentItems = shop.currentShopItems; + String inp = ""; + System.out.println(""); + System.out.println("Welches Item wollen Sie kaufen? "); + for(int i = 0; i < currentItems.size(); i++){ + System.out.println((i + 1) + " eingaben fuer " + currentItems.get(i).name + " | Kosten: " + currentItems.get(i).gold + " | Anzahl: " + currentItems.get(i).amount); + } + System.out.println("0 eingeben fuer eine andere Option."); + + while (true){ + inp = scanner.nextLine(); + if(inp.equals("0")){ + break; + } + System.out.print("Anzahl eingeben: "); + int existingCount = currentItems.get(Integer.parseInt(inp) - 1).amount; + String inpAmount = scanner.nextLine(); + if(Integer.parseInt(inpAmount) <= existingCount){ + if(shop.buy(currentItems.get(Integer.parseInt(inp) - 1).name, Integer.parseInt(inpAmount))){ + System.out.println(""); + System.out.println("Vielen Dank fuer deinen Einkauf!"); + System.out.println(""); + break; + }else { + break; + } + }else { + System.out.println("Error!"); + } + } } else if(input.equals("2")){ //shop.quiz() } else if(input.equals("3")){ From ef4a818ace531f07620c0de25b45b27593f8691e Mon Sep 17 00:00:00 2001 From: Max Gerbeth Date: Sun, 15 Jan 2023 17:57:35 +0100 Subject: [PATCH 022/152] Create JSONObjects in Shop.buy() --- src/main/java/org/bitbiome/shop/Shop.java | 25 +++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/bitbiome/shop/Shop.java b/src/main/java/org/bitbiome/shop/Shop.java index 6e9fe3b..0fdd3c5 100644 --- a/src/main/java/org/bitbiome/shop/Shop.java +++ b/src/main/java/org/bitbiome/shop/Shop.java @@ -4,6 +4,7 @@ import org.json.JSONArray; import org.json.JSONObject; import java.io.File; +import java.io.FileWriter; import java.nio.file.Files; import java.nio.file.Paths; import java.util.ArrayList; @@ -19,8 +20,28 @@ public class Shop { currentShopItems = loadPartofItems(allItems, 2); } - public boolean buy(){ - //ToDo + public boolean buy(String itemName, int amount){ + System.out.println("Hallo"); + //Create File Objects + File filePlayerConfig = new File("src/main/resources/playerconfig.json"); + File fileGameConfig = new File("src/main/resources/gameconfig.json"); + File fileItem = new File("src/main/resources/items.json"); + try { + //Create JSONObjects + String content1 = new String(Files.readAllBytes(Paths.get(filePlayerConfig.toURI())), "UTF-8"); + JSONObject playerConfig = new JSONObject(content1); + + String content2 = new String(Files.readAllBytes(Paths.get(fileGameConfig.toURI())), "UTF-8"); + JSONObject gameConfig = new JSONObject(content2); + + String content3 = new String(Files.readAllBytes(Paths.get(fileItem.toURI())), "UTF-8"); + JSONArray itemJSON = new JSONArray(content3); + + + + }catch (Exception e){ + e.printStackTrace(); + } return true; } From 271532d3c42830c2312a10587192be743d4fab89 Mon Sep 17 00:00:00 2001 From: Max Gerbeth Date: Sun, 15 Jan 2023 17:58:43 +0100 Subject: [PATCH 023/152] Test if item still available in the shop --- src/main/java/org/bitbiome/shop/Shop.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/main/java/org/bitbiome/shop/Shop.java b/src/main/java/org/bitbiome/shop/Shop.java index 0fdd3c5..8753169 100644 --- a/src/main/java/org/bitbiome/shop/Shop.java +++ b/src/main/java/org/bitbiome/shop/Shop.java @@ -37,6 +37,21 @@ public class Shop { String content3 = new String(Files.readAllBytes(Paths.get(fileItem.toURI())), "UTF-8"); JSONArray itemJSON = new JSONArray(content3); + //Test if item still available in the shop + int itemIndex = -1; + for(int i = 0; i < currentShopItems.size(); i++){ + if(currentShopItems.get(i).getName().equals(itemName)){ + itemIndex = i; + } + } + if(itemIndex == -1){ + System.out.println("Dieses Item gibt es nicht"); + return false; + } + if(!(currentShopItems.get(itemIndex).amount > 0)){ + System.out.println("Es gibt zu wenige Items"); + return false; + } }catch (Exception e){ From 7f20018078b47e6a78f2013ffed9297ff708a41e Mon Sep 17 00:00:00 2001 From: Max Gerbeth Date: Sun, 15 Jan 2023 17:59:10 +0100 Subject: [PATCH 024/152] Test if the player has enough gold --- src/main/java/org/bitbiome/shop/Shop.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/java/org/bitbiome/shop/Shop.java b/src/main/java/org/bitbiome/shop/Shop.java index 8753169..eb30b21 100644 --- a/src/main/java/org/bitbiome/shop/Shop.java +++ b/src/main/java/org/bitbiome/shop/Shop.java @@ -53,6 +53,13 @@ public class Shop { return false; } + //Test if the player has enough gold + int costs = currentShopItems.get(itemIndex).gold * amount; + int gold = (int) playerConfig.get("gold"); + if(!(gold >= costs)){ + System.out.println("Du hast zu wenig Gold!"); + return false; + } }catch (Exception e){ e.printStackTrace(); From 70ace999d0570224d8e35d11b4690be426f8d0a1 Mon Sep 17 00:00:00 2001 From: Max Gerbeth Date: Sun, 15 Jan 2023 17:59:42 +0100 Subject: [PATCH 025/152] Give Player the Item --- src/main/java/org/bitbiome/shop/Shop.java | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/main/java/org/bitbiome/shop/Shop.java b/src/main/java/org/bitbiome/shop/Shop.java index eb30b21..481b6f4 100644 --- a/src/main/java/org/bitbiome/shop/Shop.java +++ b/src/main/java/org/bitbiome/shop/Shop.java @@ -61,6 +61,28 @@ public class Shop { return false; } + //Player gold subtract + gold -= costs; + playerConfig.put("gold", gold); + + //Give Player the Item + JSONArray jsonArray = playerConfig.getJSONArray("inventory"); + String newAmount; + for(int i = 0; i < jsonArray.length(); i++) { + JSONObject tempJSON = jsonArray.getJSONObject(i); + if (tempJSON.getString("name").equals(itemName)) { + newAmount = String.valueOf((Integer.parseInt(tempJSON.getString("amount"))) + amount); + jsonArray.remove(i); + tempJSON.put("amount", newAmount); + jsonArray.put(tempJSON); + playerConfig.put("inventory", jsonArray); + FileWriter fileWriter = new FileWriter("src/main/resources/playerconfig.json"); + fileWriter.write(playerConfig.toString()); + fileWriter.close(); + return true; + } + } + }catch (Exception e){ e.printStackTrace(); } From f110417e517c3d1376e011b88f0fd03ecedcbf2c Mon Sep 17 00:00:00 2001 From: Max Gerbeth Date: Sun, 15 Jan 2023 18:00:21 +0100 Subject: [PATCH 026/152] Item do not exist in the playerinventory --- src/main/java/org/bitbiome/shop/Shop.java | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/main/java/org/bitbiome/shop/Shop.java b/src/main/java/org/bitbiome/shop/Shop.java index 481b6f4..529caca 100644 --- a/src/main/java/org/bitbiome/shop/Shop.java +++ b/src/main/java/org/bitbiome/shop/Shop.java @@ -83,6 +83,26 @@ public class Shop { } } + //Item do not exist in the playerinventory + int durability = 0; + for(int i = 0; i < itemJSON.length(); i++){ + JSONObject tempJSON = itemJSON.getJSONObject(i); + if(tempJSON.getString("name").equals(itemName)){ + durability = (int) tempJSON.get("durability"); + } + } + + JSONObject inventory = new JSONObject(); + inventory.put("name", itemName); + inventory.put("amount", 1); + inventory.put("durability", durability); + + jsonArray.put(inventory); + playerConfig.put("inventory", jsonArray); + FileWriter fileWriter = new FileWriter("src/main/resources/playerconfig.json"); + fileWriter.write(playerConfig.toString()); + fileWriter.close(); + }catch (Exception e){ e.printStackTrace(); } From 002854d8ba082bcd2b321c32a25f5a10e1a90d7f Mon Sep 17 00:00:00 2001 From: Max Gerbeth Date: Sun, 15 Jan 2023 19:02:54 +0100 Subject: [PATCH 027/152] Shop.java Give Player the Item --- src/main/java/org/bitbiome/shop/Shop.java | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/bitbiome/shop/Shop.java b/src/main/java/org/bitbiome/shop/Shop.java index 529caca..fceff83 100644 --- a/src/main/java/org/bitbiome/shop/Shop.java +++ b/src/main/java/org/bitbiome/shop/Shop.java @@ -21,7 +21,6 @@ public class Shop { } public boolean buy(String itemName, int amount){ - System.out.println("Hallo"); //Create File Objects File filePlayerConfig = new File("src/main/resources/playerconfig.json"); File fileGameConfig = new File("src/main/resources/gameconfig.json"); @@ -65,6 +64,25 @@ public class Shop { gold -= costs; playerConfig.put("gold", gold); + //Gameconfig amount reduese + JSONArray jsonArray2 = gameConfig.getJSONArray("shopitems"); + int intNewAmount; + + for(int i = 0; i < jsonArray2.length(); i++) { + JSONObject tempJSON = jsonArray2.getJSONObject(i); + if (tempJSON.getString("name").equals(itemName)) { + intNewAmount = (int) tempJSON.get("amount") - amount; + jsonArray2.remove(i); + tempJSON.put("amount", intNewAmount); + jsonArray2.put(tempJSON); + gameConfig.put("shopitems", jsonArray2); + FileWriter fileWriter = new FileWriter("src/main/resources/gameconfig.json"); + fileWriter.write(gameConfig.toString()); + fileWriter.close(); + currentShopItems = loadItems(); + } + } + //Give Player the Item JSONArray jsonArray = playerConfig.getJSONArray("inventory"); String newAmount; From 5136f095bc80f1e321d3d323124b72cd8e6838b4 Mon Sep 17 00:00:00 2001 From: Max Gerbeth Date: Sun, 15 Jan 2023 19:05:10 +0100 Subject: [PATCH 028/152] refactoring: loadItems() to loadCurrentShopItems() --- src/main/java/org/bitbiome/shop/Shop.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/bitbiome/shop/Shop.java b/src/main/java/org/bitbiome/shop/Shop.java index fceff83..4721512 100644 --- a/src/main/java/org/bitbiome/shop/Shop.java +++ b/src/main/java/org/bitbiome/shop/Shop.java @@ -16,7 +16,7 @@ public class Shop { public ArrayList currentShopItems; public Shop(){ - allItems = loadItems(); + allItems = loadCurrentShopItems(); currentShopItems = loadPartofItems(allItems, 2); } @@ -79,7 +79,7 @@ public class Shop { FileWriter fileWriter = new FileWriter("src/main/resources/gameconfig.json"); fileWriter.write(gameConfig.toString()); fileWriter.close(); - currentShopItems = loadItems(); + currentShopItems = loadCurrentShopItems(); } } @@ -128,7 +128,7 @@ public class Shop { return true; } - private ArrayList loadItems(){ + private ArrayList loadCurrentShopItems(){ File file = new File("src/main/resources/gameconfig.json"); ArrayList arrayList = new ArrayList(); try { From be84a78653fccd761126c823d95ea56eda168733 Mon Sep 17 00:00:00 2001 From: Max Gerbeth Date: Sun, 15 Jan 2023 19:11:13 +0100 Subject: [PATCH 029/152] refactoring: add to item.json "amountShop" and "gold" --- src/main/resources/items.json | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/main/resources/items.json b/src/main/resources/items.json index 85b3f26..f482e12 100644 --- a/src/main/resources/items.json +++ b/src/main/resources/items.json @@ -3,24 +3,32 @@ "name": "Holz", "damage": "1-3", "crafting": true, - "durability": 1000 + "durability": 1000, + "amountShop": 10, + "gold": 10 }, { "name": "Heiliges Schwert der Engel", "damage": "1000", "crafting": false, - "durability": 1000 + "durability": 1000, + "amountShop": 1, + "gold": 1000 }, { "name": "Stein", "damage": "5-10", "crafting": true, - "durability": 1000 + "durability": 1000, + "amountShop": 1500, + "gold": 2 }, { "name": "Fell", "damage": "0", "crafting": true, - "durability": 1000 + "durability": 1000, + "amountShop": 500, + "gold": 100 } ] \ No newline at end of file From 5dadc57cdbc4f9c504384f70441639b3a8375f9b Mon Sep 17 00:00:00 2001 From: Max Gerbeth Date: Sun, 15 Jan 2023 19:23:10 +0100 Subject: [PATCH 030/152] refactoring: items.json --- src/main/resources/items.json | 71 ++++++++++++++++++----------------- 1 file changed, 37 insertions(+), 34 deletions(-) diff --git a/src/main/resources/items.json b/src/main/resources/items.json index f482e12..cb500a4 100644 --- a/src/main/resources/items.json +++ b/src/main/resources/items.json @@ -1,34 +1,37 @@ -[ - { - "name": "Holz", - "damage": "1-3", - "crafting": true, - "durability": 1000, - "amountShop": 10, - "gold": 10 - }, - { - "name": "Heiliges Schwert der Engel", - "damage": "1000", - "crafting": false, - "durability": 1000, - "amountShop": 1, - "gold": 1000 - }, - { - "name": "Stein", - "damage": "5-10", - "crafting": true, - "durability": 1000, - "amountShop": 1500, - "gold": 2 - }, - { - "name": "Fell", - "damage": "0", - "crafting": true, - "durability": 1000, - "amountShop": 500, - "gold": 100 - } -] \ No newline at end of file +{ + "items": + [ + { + "name": "Holz", + "damage": "1-3", + "crafting": true, + "durability": 1000, + "amountShop": 10, + "gold": 10 + }, + { + "name": "Heiliges Schwert der Engel", + "damage": "1000", + "crafting": false, + "durability": 1000, + "amountShop": 1, + "gold": 1000 + }, + { + "name": "Stein", + "damage": "5-10", + "crafting": true, + "durability": 1000, + "amountShop": 1500, + "gold": 2 + }, + { + "name": "Fell", + "damage": "0", + "crafting": true, + "durability": 1000, + "amountShop": 500, + "gold": 100 + } + ] +} \ No newline at end of file From 7680773885cfcbf7c99911441f442e67abff5ff7 Mon Sep 17 00:00:00 2001 From: Max Gerbeth Date: Sun, 15 Jan 2023 19:23:44 +0100 Subject: [PATCH 031/152] implements: loadAllItems() --- src/main/java/org/bitbiome/shop/Shop.java | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/bitbiome/shop/Shop.java b/src/main/java/org/bitbiome/shop/Shop.java index 4721512..de31cfa 100644 --- a/src/main/java/org/bitbiome/shop/Shop.java +++ b/src/main/java/org/bitbiome/shop/Shop.java @@ -16,7 +16,7 @@ public class Shop { public ArrayList currentShopItems; public Shop(){ - allItems = loadCurrentShopItems(); + allItems = loadAllItems(); currentShopItems = loadPartofItems(allItems, 2); } @@ -128,6 +128,25 @@ public class Shop { return true; } + private ArrayList loadAllItems(){ + File file = new File("src/main/resources/items.json"); + ArrayList arrayList = new ArrayList(); + try { + String content = new String(Files.readAllBytes(Paths.get(file.toURI())), "UTF-8"); + JSONObject jsonObject = new JSONObject(content); + + JSONArray jsonArray = jsonObject.getJSONArray("items"); + for(int i = 0; i < jsonArray.length(); i++){ + JSONObject tempJSON = jsonArray.getJSONObject(i); + arrayList.add(new Item(tempJSON.getString("name"), tempJSON.getInt("amountShop"), tempJSON.getInt("gold"))); + } + }catch (Exception e){ + e.printStackTrace(); + } + + return arrayList; + } + private ArrayList loadCurrentShopItems(){ File file = new File("src/main/resources/gameconfig.json"); ArrayList arrayList = new ArrayList(); From 67ce5e7300004c4be7736902bb2fc8b341c18ad2 Mon Sep 17 00:00:00 2001 From: Max Gerbeth Date: Sun, 15 Jan 2023 19:40:49 +0100 Subject: [PATCH 032/152] refactoring: items.json --- src/main/resources/items.json | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main/resources/items.json b/src/main/resources/items.json index cb500a4..3841afc 100644 --- a/src/main/resources/items.json +++ b/src/main/resources/items.json @@ -1,5 +1,4 @@ -{ - "items": + [ { "name": "Holz", @@ -34,4 +33,3 @@ "gold": 100 } ] -} \ No newline at end of file From ad1efd076f13f2cee4cf9ce382502cfa7100493e Mon Sep 17 00:00:00 2001 From: Max Gerbeth Date: Wed, 18 Jan 2023 09:39:28 +0100 Subject: [PATCH 033/152] refactoring: ShopCommand.java --- .../org/bitbiome/commands/ShopCommand.java | 52 ++++++++----------- 1 file changed, 23 insertions(+), 29 deletions(-) diff --git a/src/main/java/org/bitbiome/commands/ShopCommand.java b/src/main/java/org/bitbiome/commands/ShopCommand.java index 369e7a4..4891942 100644 --- a/src/main/java/org/bitbiome/commands/ShopCommand.java +++ b/src/main/java/org/bitbiome/commands/ShopCommand.java @@ -3,18 +3,22 @@ package org.bitbiome.commands; import org.bitbiome.shop.Item; import org.bitbiome.shop.Shop; +import java.io.IOException; import java.util.ArrayList; import java.util.Scanner; public class ShopCommand implements CommandAPI{ - Shop shop = new Shop(); + + Shop shop = new Shop(); + public ShopCommand(){ + + } @Override public void performCommand(Scanner scanner, boolean isRunning, String message) { System.out.println("Willkommen im Shop!"); - System.out.println("Folgende Items sind aktuell im Shop:"); - shop.printCurrentShopItems(); - ArrayList currentItems; + ArrayList currentItems = shop.loadCurrentShopItems(); + while (true){ System.out.println("Was willst Du hier im Shop?"); @@ -25,34 +29,24 @@ public class ShopCommand implements CommandAPI{ String input = scanner.nextLine(); if(validInput(input)){ if(input.equals("1")){ - currentItems = shop.currentShopItems; - String inp = ""; - System.out.println(""); - System.out.println("Welches Item wollen Sie kaufen? "); + System.out.println("Folgende sind folgende Items im Shop: "); for(int i = 0; i < currentItems.size(); i++){ - System.out.println((i + 1) + " eingaben fuer " + currentItems.get(i).name + " | Kosten: " + currentItems.get(i).gold + " | Anzahl: " + currentItems.get(i).amount); + System.out.println((i + 1) + ". " + currentItems.get(i).name + " | Anzahl: " + currentItems.get(i).amount + " | Gold: " + currentItems.get(i).gold); } - System.out.println("0 eingeben fuer eine andere Option."); - - while (true){ - inp = scanner.nextLine(); - if(inp.equals("0")){ - break; - } + System.out.println("0 Eingeben um den Shop zu verlassen."); + System.out.println(""); + System.out.print("Welches Item moechtest du kaufen? "); + String itemNumber = scanner.nextLine(); + if(!itemNumber.equals("0")){ System.out.print("Anzahl eingeben: "); - int existingCount = currentItems.get(Integer.parseInt(inp) - 1).amount; - String inpAmount = scanner.nextLine(); - if(Integer.parseInt(inpAmount) <= existingCount){ - if(shop.buy(currentItems.get(Integer.parseInt(inp) - 1).name, Integer.parseInt(inpAmount))){ - System.out.println(""); - System.out.println("Vielen Dank fuer deinen Einkauf!"); - System.out.println(""); - break; - }else { - break; - } - }else { - System.out.println("Error!"); + String amount = scanner.nextLine(); + if((Integer.parseInt(amount) <= currentItems.get(Integer.parseInt(itemNumber) - 1).amount) && ((Integer.parseInt(amount) - 1) > -1)){ + shop.buy(currentItems.get(Integer.parseInt(itemNumber) - 1).name, Integer.parseInt(amount)); + currentItems = shop.loadCurrentShopItems(); + System.out.println(""); + System.out.println("Vielen Dank für Ihren Einkauf!"); + }else{ + System.out.println("Fehler"); } } } else if(input.equals("2")){ From ad42f3ff857bbaa07157e013ba37dbceacebad85 Mon Sep 17 00:00:00 2001 From: Friederike von Gruben Date: Wed, 18 Jan 2023 22:23:44 +0100 Subject: [PATCH 034/152] Added writeObject method to the JSON Parser to write json objects --- .../java/org/bitbiome/classes/JsonParser.java | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/bitbiome/classes/JsonParser.java b/src/main/java/org/bitbiome/classes/JsonParser.java index be0e9b8..56a9535 100644 --- a/src/main/java/org/bitbiome/classes/JsonParser.java +++ b/src/main/java/org/bitbiome/classes/JsonParser.java @@ -2,8 +2,14 @@ package org.bitbiome.classes; import org.json.JSONObject; import org.json.JSONTokener; +import org.json.JSONWriter; +import java.io.FileWriter; +import java.io.IOException; import java.io.InputStream; +import java.io.StringWriter; + + public class JsonParser { @@ -30,7 +36,20 @@ public class JsonParser { } JSONTokener tokener = new JSONTokener(is); - return new JSONObject(tokener); } + + public static void writeObject(String fileName, JSONObject object) { + + String resourceName = System.getProperty("user.dir") + "/src/main/resources/" + fileName; + try { + FileWriter fw = new FileWriter(resourceName, false); + fw.write(object.toString(1)); + fw.close(); + } catch (IOException e) { + throw new RuntimeException(e); + } + + + } } From 6405c41b32652033eb184ff97006ac34cc48f6c3 Mon Sep 17 00:00:00 2001 From: Friederike von Gruben Date: Wed, 18 Jan 2023 22:25:46 +0100 Subject: [PATCH 035/152] Added new questions --- src/main/resources/quiz.json | 204 +++++++++++++++++++++++++++++++++++ 1 file changed, 204 insertions(+) create mode 100644 src/main/resources/quiz.json diff --git a/src/main/resources/quiz.json b/src/main/resources/quiz.json new file mode 100644 index 0000000..cc58a3f --- /dev/null +++ b/src/main/resources/quiz.json @@ -0,0 +1,204 @@ +{ + "Quiz": [ + { + "frage": "Wie lang ist der Äquator der Erde?", + "antworten": [ + "20.000m", + "30km", + "60.000km", + "40.000km" + ], + "korrekteAntwort": "40.000km" + }, + { + "frage": "Was ist der längste Fluss der Welt?", + "antworten": [ + "Amazonas", + "Nil", + "Rhein", + "Niger" + ], + "korrekteAntwort": "Nil" + }, + { + "frage": "Wie viele Tasten hat ein Klavier?", + "antworten": [ + "74", + "86", + "82", + "88" + ], + "korrekteAntwort": "88" + }, + { + "frage": "Von wem wird der Bundespräsident gewählt?", + "antworten": [ + "Vom Europäischen Parlament", + "Vom Bundeskanzler", + "Vom Bundestag", + "Von der Bundesversammlung" + ], + "korrekteAntwort": "von der Bundesversammlung" + }, + { + "frage": "Welches Land produziert jährlich die meisten Filme?", + "antworten": [ + "USA", + "Indien", + "Japan", + "Nigeria" + ], + "korrekteAntwort": "Indien" + }, + { + "frage": "Wie heißt der am schnellsten schwimmende Fisch auf Erden?", + "antworten": [ + "Flugfisch", + "Tigerhai", + "Segelfisch", + "Windfisch" + ], + "korrekteAntwort": "Segelfisch" + }, + { + "frage": "Was ist KEIN Gewächs?", + "antworten": [ + "Geranie", + "Moosfarn", + "Incolornis", + "Strandflieder" + ], + "korrekteAntwort": "Incolornis" + }, + { + "frage": "Was nutzt eine Fledermaus zur Orientierung in der Luft?", + "antworten": [ + "Infrarot", + "Röntgenstrahlen", + "Speichel", + "Ultraschall" + ], + "korrekteAntwort": "Ultraschall" + }, + { + "frage": "Von wem stammt der berühmte Satz: 'Ich denke, also bin ich'?", + "antworten": [ + "John Fitzgerald Kennedy", + "George Walker Bush", + "René Descartes", + "Julius Caesar" + ], + "korrekteAntwort": "René Descartes" + }, + { + "frage": "Welches Lebensmittel enthält das meiste Wasser?", + "antworten": [ + "Gurke", + "Wassermelone", + "Zitrone", + "Paprika" + ], + "korrekteAntwort": "Gurke" + }, + { + "frage": "Welches Lebensmittel gehört im botanischen Sinne zu den Früchten?", + "antworten": [ + "Möhre", + "Kartoffel", + "Tomate", + "Weißkohl" + ], + "korrekteAntwort": "Tomate" + }, + { + "frage": "Haptische Wahrnehmung beruht auf dem...?", + "antworten": [ + "Greifreflex", + "Gleichgewichtssinn", + "Hörsinn", + "Tastsinn" + ], + "korrekteAntwort": "Tastsinn" + }, + { + "frage": "Wie nennt man den letzten Tanz einer Tanzveranstaltung?", + "antworten": [ + "Voraus", + "Garaus", + "Kehraus", + "Durchaus" + ], + "korrekteAntwort": "Kehraus" + }, + { + "frage": "Wie nennt man ein tiefes, enges Tal, durch das ein Gebirgsbach fließt?", + "antworten": [ + "Klamm", + "Feucht", + "Nass", + "Schwamm" + ], + "korrekteAntwort": "Klamm" + }, + { + "frage": "Wer oder was ist Gerbera?", + "antworten": [ + "eine europäische Landschaft", + "eine Pflanze", + "die erste Präsidentin von Südafrika", + "eine Stadt in Lichtenstein" + ], + "korrekteAntwort": "eine Pflanze" + }, + { + "frage": "Nach wem wurde ein Gesellschaftsanzug benannt?", + "antworten": [ + "Richard von Weizsäcker", + "Gustav Heinemann", + "Jürgen Klinsmann", + "Gustav Stresemann" + ], + "korrekteAntwort": "Gustav Stresemann" + }, + { + "frage": "Was ist Speckstein?", + "antworten": [ + "eine Fischart, die sich als Stein tarnt", + "ein Gericht aus dem Mittelalter", + "eine Skulptur im Römischen Reich unter Nero", + "ein besonders weicher Stein" + ], + "korrekteAntwort": "ein besonders weicher Stein" + }, + { + "frage": "In welcher Religion gibt es Gurus?", + "antworten": [ + "im Christentum", + "im Hinduismus", + "im Islam", + "im Judentum" + ], + "korrekteAntwort": "im Hinduismus" + }, + { + "frage": "Was versteht man unter Brunsbüttel?", + "antworten": [ + "eine Industriestadt an der Unterelbe", + "einen Plakatkleber", + "eine 630 Mark-Kraft", + "ein Staatssekretär" + ], + "korrekteAntwort": "eine Industriestadt an der Unterelbe" + }, + { + "frage": "Welcher im 11. Jahrhundert gegründeter Orden rettet und pfelgt auch noch heute Verletzte und Kranke?", + "antworten": [ + "die Dominikaner", + "die Augustiner", + "die Zisterzienser", + "die Johanniter" + ], + "korrekteAntwort": "die Johanniter" + } + ] +} \ No newline at end of file From c9fad47496fd1ab317b296921d820976515b2372 Mon Sep 17 00:00:00 2001 From: Max Gerbeth Date: Thu, 19 Jan 2023 23:32:48 +0100 Subject: [PATCH 036/152] bugfixes --- .../org/bitbiome/commands/ShopCommand.java | 8 +-- src/main/java/org/bitbiome/shop/Shop.java | 64 +++++++++++++------ .../bitbiome/commands/HelpCommandTest.java | 0 .../bitbiome/commands/QuitCommandTest.java | 0 .../bitbiome/commands/ShopCommandTest.java | 0 5 files changed, 50 insertions(+), 22 deletions(-) mode change 100644 => 100755 src/test/java/org/bitbiome/commands/HelpCommandTest.java mode change 100644 => 100755 src/test/java/org/bitbiome/commands/QuitCommandTest.java mode change 100644 => 100755 src/test/java/org/bitbiome/commands/ShopCommandTest.java diff --git a/src/main/java/org/bitbiome/commands/ShopCommand.java b/src/main/java/org/bitbiome/commands/ShopCommand.java index 4891942..b718926 100644 --- a/src/main/java/org/bitbiome/commands/ShopCommand.java +++ b/src/main/java/org/bitbiome/commands/ShopCommand.java @@ -9,10 +9,10 @@ import java.util.Scanner; public class ShopCommand implements CommandAPI{ - Shop shop = new Shop(); - public ShopCommand(){ + Shop shop = new Shop(); + public ShopCommand(){ - } + } @Override public void performCommand(Scanner scanner, boolean isRunning, String message) { @@ -41,7 +41,7 @@ public class ShopCommand implements CommandAPI{ System.out.print("Anzahl eingeben: "); String amount = scanner.nextLine(); if((Integer.parseInt(amount) <= currentItems.get(Integer.parseInt(itemNumber) - 1).amount) && ((Integer.parseInt(amount) - 1) > -1)){ - shop.buy(currentItems.get(Integer.parseInt(itemNumber) - 1).name, Integer.parseInt(amount)); + boolean bool = shop.buy(currentItems.get(Integer.parseInt(itemNumber) - 1).name, Integer.parseInt(amount)); currentItems = shop.loadCurrentShopItems(); System.out.println(""); System.out.println("Vielen Dank für Ihren Einkauf!"); diff --git a/src/main/java/org/bitbiome/shop/Shop.java b/src/main/java/org/bitbiome/shop/Shop.java index de31cfa..aa15493 100644 --- a/src/main/java/org/bitbiome/shop/Shop.java +++ b/src/main/java/org/bitbiome/shop/Shop.java @@ -5,6 +5,7 @@ import org.json.JSONObject; import java.io.File; import java.io.FileWriter; +import java.io.IOException; import java.nio.file.Files; import java.nio.file.Paths; import java.util.ArrayList; @@ -15,13 +16,18 @@ public class Shop { public ArrayList allItems; public ArrayList currentShopItems; - public Shop(){ - allItems = loadAllItems(); - currentShopItems = loadPartofItems(allItems, 2); + public Shop() { + try { + allItems = loadAllItems(); + currentShopItems = loadPartofItems(allItems, 3); + }catch (Exception e){ + e.printStackTrace(); + } } public boolean buy(String itemName, int amount){ //Create File Objects + currentShopItems = loadCurrentShopItems(); File filePlayerConfig = new File("src/main/resources/playerconfig.json"); File fileGameConfig = new File("src/main/resources/gameconfig.json"); File fileItem = new File("src/main/resources/items.json"); @@ -51,7 +57,6 @@ public class Shop { System.out.println("Es gibt zu wenige Items"); return false; } - //Test if the player has enough gold int costs = currentShopItems.get(itemIndex).gold * amount; int gold = (int) playerConfig.get("gold"); @@ -71,7 +76,7 @@ public class Shop { for(int i = 0; i < jsonArray2.length(); i++) { JSONObject tempJSON = jsonArray2.getJSONObject(i); if (tempJSON.getString("name").equals(itemName)) { - intNewAmount = (int) tempJSON.get("amount") - amount; + intNewAmount = tempJSON.getInt("amount") - amount; jsonArray2.remove(i); tempJSON.put("amount", intNewAmount); jsonArray2.put(tempJSON); @@ -80,16 +85,17 @@ public class Shop { fileWriter.write(gameConfig.toString()); fileWriter.close(); currentShopItems = loadCurrentShopItems(); + break; } } //Give Player the Item JSONArray jsonArray = playerConfig.getJSONArray("inventory"); - String newAmount; + int newAmount; for(int i = 0; i < jsonArray.length(); i++) { JSONObject tempJSON = jsonArray.getJSONObject(i); if (tempJSON.getString("name").equals(itemName)) { - newAmount = String.valueOf((Integer.parseInt(tempJSON.getString("amount"))) + amount); + newAmount = tempJSON.getInt("amount") + amount; jsonArray.remove(i); tempJSON.put("amount", newAmount); jsonArray.put(tempJSON); @@ -103,9 +109,9 @@ public class Shop { //Item do not exist in the playerinventory int durability = 0; - for(int i = 0; i < itemJSON.length(); i++){ + for(int i = 0; i < itemJSON.length(); i++) { JSONObject tempJSON = itemJSON.getJSONObject(i); - if(tempJSON.getString("name").equals(itemName)){ + if (tempJSON.getString("name").equals(itemName)) { durability = (int) tempJSON.get("durability"); } } @@ -132,12 +138,11 @@ public class Shop { File file = new File("src/main/resources/items.json"); ArrayList arrayList = new ArrayList(); try { - String content = new String(Files.readAllBytes(Paths.get(file.toURI())), "UTF-8"); - JSONObject jsonObject = new JSONObject(content); + String content3 = new String(Files.readAllBytes(Paths.get(file.toURI())), "UTF-8"); + JSONArray itemJSON = new JSONArray(content3); - JSONArray jsonArray = jsonObject.getJSONArray("items"); - for(int i = 0; i < jsonArray.length(); i++){ - JSONObject tempJSON = jsonArray.getJSONObject(i); + for(int i = 0; i < itemJSON.length(); i++){ + JSONObject tempJSON = itemJSON.getJSONObject(i); arrayList.add(new Item(tempJSON.getString("name"), tempJSON.getInt("amountShop"), tempJSON.getInt("gold"))); } }catch (Exception e){ @@ -147,7 +152,7 @@ public class Shop { return arrayList; } - private ArrayList loadCurrentShopItems(){ + public ArrayList loadCurrentShopItems(){ File file = new File("src/main/resources/gameconfig.json"); ArrayList arrayList = new ArrayList(); try { @@ -166,22 +171,45 @@ public class Shop { return arrayList; } - private ArrayList loadPartofItems(ArrayList alleItems, int itemCount){ + private ArrayList loadPartofItems(ArrayList alleItems, int itemCount) { ArrayList arrayList = new ArrayList(); + try{ + File fileGameConfig = new File("src/main/resources/gameconfig.json"); + String content2 = new String(Files.readAllBytes(Paths.get(fileGameConfig.toURI())), "UTF-8"); + JSONObject gameConfig = new JSONObject(content2); + + JSONArray jsonArray = gameConfig.getJSONArray("shopitems"); HashSet hashSet = new HashSet<>(); + JSONArray shopitems = new JSONArray(); Random random = new Random(); while (hashSet.size() < itemCount){ int rand = random.nextInt(alleItems.size()); if(!hashSet.contains(rand)){ hashSet.add(rand); arrayList.add(alleItems.get(rand)); + JSONObject jsonObject = new JSONObject(); + jsonObject.put("name", alleItems.get(rand).name); + jsonObject.put("amount", alleItems.get(rand).amount); + jsonObject.put("gold", alleItems.get(rand).gold); + shopitems.put(jsonObject); } } + //write in gameconfig.json + gameConfig.remove("shopitems"); + gameConfig.put("shopitems", shopitems); + FileWriter fileWriter = new FileWriter("src/main/resources/gameconfig.json"); + fileWriter.write(gameConfig.toString()); + fileWriter.close(); + }catch (Exception e){ + e.printStackTrace(); + } + + return arrayList; } - public void itemRotation(){ - currentShopItems = loadPartofItems(allItems, 2); + public void itemRotation() throws IOException { + currentShopItems = loadPartofItems(allItems, 3); } public void printCurrentShopItems(){ diff --git a/src/test/java/org/bitbiome/commands/HelpCommandTest.java b/src/test/java/org/bitbiome/commands/HelpCommandTest.java old mode 100644 new mode 100755 diff --git a/src/test/java/org/bitbiome/commands/QuitCommandTest.java b/src/test/java/org/bitbiome/commands/QuitCommandTest.java old mode 100644 new mode 100755 diff --git a/src/test/java/org/bitbiome/commands/ShopCommandTest.java b/src/test/java/org/bitbiome/commands/ShopCommandTest.java old mode 100644 new mode 100755 From ac443832b7913f72d76d217908511f13c22cb9eb Mon Sep 17 00:00:00 2001 From: Max Gerbeth Date: Thu, 19 Jan 2023 23:42:48 +0100 Subject: [PATCH 037/152] unittest: testValidInput2 --- src/test/java/org/bitbiome/commands/ShopCommandTest.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/test/java/org/bitbiome/commands/ShopCommandTest.java b/src/test/java/org/bitbiome/commands/ShopCommandTest.java index 449fc23..a024816 100755 --- a/src/test/java/org/bitbiome/commands/ShopCommandTest.java +++ b/src/test/java/org/bitbiome/commands/ShopCommandTest.java @@ -8,9 +8,15 @@ import static org.junit.jupiter.api.Assertions.assertEquals; public class ShopCommandTest { final ShopCommand shopCommand = new ShopCommand(); @Test - public void testValidInput(){ + public void testValidInput1(){ boolean expected = true; boolean result = shopCommand.validInput("1"); assertEquals(expected, result); } + @Test + public void testValidInput2(){ + boolean expected = true; + boolean result = shopCommand.validInput("2"); + assertEquals(expected, result); + } } From ba4278790b55d7d4d08e5b823965035a94c95d53 Mon Sep 17 00:00:00 2001 From: Max Gerbeth Date: Thu, 19 Jan 2023 23:43:37 +0100 Subject: [PATCH 038/152] unittest: testValidInput3 --- src/test/java/org/bitbiome/commands/ShopCommandTest.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/test/java/org/bitbiome/commands/ShopCommandTest.java b/src/test/java/org/bitbiome/commands/ShopCommandTest.java index a024816..df98d22 100755 --- a/src/test/java/org/bitbiome/commands/ShopCommandTest.java +++ b/src/test/java/org/bitbiome/commands/ShopCommandTest.java @@ -19,4 +19,10 @@ public class ShopCommandTest { boolean result = shopCommand.validInput("2"); assertEquals(expected, result); } + @Test + public void testValidInput3(){ + boolean expected = true; + boolean result = shopCommand.validInput("3"); + assertEquals(expected, result); + } } From 88496d7252d6bb2db0532fe33b4e55badda37ed4 Mon Sep 17 00:00:00 2001 From: Max Gerbeth Date: Thu, 19 Jan 2023 23:44:26 +0100 Subject: [PATCH 039/152] unittest: testValidInput4 --- src/test/java/org/bitbiome/commands/ShopCommandTest.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/test/java/org/bitbiome/commands/ShopCommandTest.java b/src/test/java/org/bitbiome/commands/ShopCommandTest.java index df98d22..0e28dfb 100755 --- a/src/test/java/org/bitbiome/commands/ShopCommandTest.java +++ b/src/test/java/org/bitbiome/commands/ShopCommandTest.java @@ -25,4 +25,10 @@ public class ShopCommandTest { boolean result = shopCommand.validInput("3"); assertEquals(expected, result); } + @Test + public void testValidInput4(){ + boolean expected = false; + boolean result = shopCommand.validInput("4"); + assertEquals(expected, result); + } } From 20ba24d5c95f85192f97a18570a859213bdc86dc Mon Sep 17 00:00:00 2001 From: Max Gerbeth Date: Thu, 19 Jan 2023 23:48:54 +0100 Subject: [PATCH 040/152] refactoring: itemRotation() --- src/main/java/org/bitbiome/shop/Shop.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/bitbiome/shop/Shop.java b/src/main/java/org/bitbiome/shop/Shop.java index aa15493..dc00dca 100644 --- a/src/main/java/org/bitbiome/shop/Shop.java +++ b/src/main/java/org/bitbiome/shop/Shop.java @@ -208,8 +208,12 @@ public class Shop { return arrayList; } - public void itemRotation() throws IOException { - currentShopItems = loadPartofItems(allItems, 3); + public void itemRotation() { + try { + currentShopItems = loadPartofItems(allItems, 3); + }catch (Exception e){ + e.printStackTrace(); + } } public void printCurrentShopItems(){ From 172c8e699716856452b54e9bd424525ec6cbb715 Mon Sep 17 00:00:00 2001 From: Max Gerbeth Date: Thu, 19 Jan 2023 23:52:16 +0100 Subject: [PATCH 041/152] Shop.java add subtractGold() --- src/main/java/org/bitbiome/shop/Shop.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/bitbiome/shop/Shop.java b/src/main/java/org/bitbiome/shop/Shop.java index dc00dca..5c4216c 100644 --- a/src/main/java/org/bitbiome/shop/Shop.java +++ b/src/main/java/org/bitbiome/shop/Shop.java @@ -66,8 +66,7 @@ public class Shop { } //Player gold subtract - gold -= costs; - playerConfig.put("gold", gold); + playerConfig.put("gold", subtractGold(gold, costs)); //Gameconfig amount reduese JSONArray jsonArray2 = gameConfig.getJSONArray("shopitems"); @@ -233,4 +232,8 @@ public class Shop { } System.out.println(""); } + + private int subtractGold(int gold, int cost){ + return gold - cost; + } } From e323599a745316a5f51cac3dcc38f4516ec83eb3 Mon Sep 17 00:00:00 2001 From: Max Gerbeth Date: Thu, 19 Jan 2023 23:57:22 +0100 Subject: [PATCH 042/152] unittest: testSubtractGold() --- src/main/java/org/bitbiome/shop/Shop.java | 2 +- .../java/org/bitbiome/commands/ShopCommandTest.java | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/bitbiome/shop/Shop.java b/src/main/java/org/bitbiome/shop/Shop.java index 5c4216c..3491896 100644 --- a/src/main/java/org/bitbiome/shop/Shop.java +++ b/src/main/java/org/bitbiome/shop/Shop.java @@ -233,7 +233,7 @@ public class Shop { System.out.println(""); } - private int subtractGold(int gold, int cost){ + public int subtractGold(int gold, int cost){ return gold - cost; } } diff --git a/src/test/java/org/bitbiome/commands/ShopCommandTest.java b/src/test/java/org/bitbiome/commands/ShopCommandTest.java index 0e28dfb..9359232 100755 --- a/src/test/java/org/bitbiome/commands/ShopCommandTest.java +++ b/src/test/java/org/bitbiome/commands/ShopCommandTest.java @@ -7,6 +7,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; public class ShopCommandTest { final ShopCommand shopCommand = new ShopCommand(); + final Shop shop = new Shop(); @Test public void testValidInput1(){ boolean expected = true; @@ -31,4 +32,13 @@ public class ShopCommandTest { boolean result = shopCommand.validInput("4"); assertEquals(expected, result); } + + + + @Test + public void testSubtractGold(){ + int expected = 1; + int result = shop.subtractGold(3, 2); + assertEquals(expected, result); + } } From 72aa9c05f79266644118cbc8c5bfa5962c7f8ebe Mon Sep 17 00:00:00 2001 From: Max Gerbeth Date: Thu, 19 Jan 2023 23:58:16 +0100 Subject: [PATCH 043/152] unittest: testSubtractGold1() --- src/test/java/org/bitbiome/commands/ShopCommandTest.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/test/java/org/bitbiome/commands/ShopCommandTest.java b/src/test/java/org/bitbiome/commands/ShopCommandTest.java index 9359232..ab8bcfa 100755 --- a/src/test/java/org/bitbiome/commands/ShopCommandTest.java +++ b/src/test/java/org/bitbiome/commands/ShopCommandTest.java @@ -41,4 +41,10 @@ public class ShopCommandTest { int result = shop.subtractGold(3, 2); assertEquals(expected, result); } + @Test + public void testSubtractGold1(){ + int expected = 10; + int result = shop.subtractGold(12, 2); + assertEquals(expected, result); + } } From 8c94c1b739675ffe473d953f7ed7cf466db122fc Mon Sep 17 00:00:00 2001 From: Max Gerbeth Date: Fri, 20 Jan 2023 00:01:35 +0100 Subject: [PATCH 044/152] unittest: testSubtractGold2() --- src/test/java/org/bitbiome/commands/ShopCommandTest.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/test/java/org/bitbiome/commands/ShopCommandTest.java b/src/test/java/org/bitbiome/commands/ShopCommandTest.java index ab8bcfa..209c01b 100755 --- a/src/test/java/org/bitbiome/commands/ShopCommandTest.java +++ b/src/test/java/org/bitbiome/commands/ShopCommandTest.java @@ -47,4 +47,10 @@ public class ShopCommandTest { int result = shop.subtractGold(12, 2); assertEquals(expected, result); } + @Test + public void testSubtractGold2(){ + int expected = 4; + int result = shop.subtractGold(7, 3); + assertEquals(expected, result); + } } From 0ecbfdc69dbae40138ae68ead1d43635d5717c69 Mon Sep 17 00:00:00 2001 From: Max Gerbeth Date: Fri, 20 Jan 2023 00:02:23 +0100 Subject: [PATCH 045/152] unittest: testSubtractGold3() --- src/test/java/org/bitbiome/commands/ShopCommandTest.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/test/java/org/bitbiome/commands/ShopCommandTest.java b/src/test/java/org/bitbiome/commands/ShopCommandTest.java index 209c01b..f070f7a 100755 --- a/src/test/java/org/bitbiome/commands/ShopCommandTest.java +++ b/src/test/java/org/bitbiome/commands/ShopCommandTest.java @@ -53,4 +53,10 @@ public class ShopCommandTest { int result = shop.subtractGold(7, 3); assertEquals(expected, result); } + @Test + public void testSubtractGold3(){ + int expected = 5; + int result = shop.subtractGold(10, 5); + assertEquals(expected, result); + } } From 421a9c8314d282bebd612b9de341a5d6ddba8f95 Mon Sep 17 00:00:00 2001 From: Max Gerbeth Date: Fri, 20 Jan 2023 00:03:15 +0100 Subject: [PATCH 046/152] unittest: testSubtractGold4() --- src/test/java/org/bitbiome/commands/ShopCommandTest.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/test/java/org/bitbiome/commands/ShopCommandTest.java b/src/test/java/org/bitbiome/commands/ShopCommandTest.java index f070f7a..8bbb163 100755 --- a/src/test/java/org/bitbiome/commands/ShopCommandTest.java +++ b/src/test/java/org/bitbiome/commands/ShopCommandTest.java @@ -59,4 +59,10 @@ public class ShopCommandTest { int result = shop.subtractGold(10, 5); assertEquals(expected, result); } + @Test + public void testSubtractGold4(){ + int expected = 1; + int result = shop.subtractGold(2, 1); + assertEquals(expected, result); + } } From 4a75478c4df6941aab4df869b9a8359705ec3235 Mon Sep 17 00:00:00 2001 From: Max Gerbeth Date: Fri, 20 Jan 2023 00:04:00 +0100 Subject: [PATCH 047/152] unittest: testSubtractGold5() --- src/test/java/org/bitbiome/commands/ShopCommandTest.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/test/java/org/bitbiome/commands/ShopCommandTest.java b/src/test/java/org/bitbiome/commands/ShopCommandTest.java index 8bbb163..54b35c1 100755 --- a/src/test/java/org/bitbiome/commands/ShopCommandTest.java +++ b/src/test/java/org/bitbiome/commands/ShopCommandTest.java @@ -65,4 +65,10 @@ public class ShopCommandTest { int result = shop.subtractGold(2, 1); assertEquals(expected, result); } + @Test + public void testSubtractGold5(){ + int expected = 10; + int result = shop.subtractGold(20, 10); + assertEquals(expected, result); + } } From cdb9e0d1d9dc46684dd6ecbb70b83e745d65cb09 Mon Sep 17 00:00:00 2001 From: Max Gerbeth Date: Fri, 20 Jan 2023 00:11:40 +0100 Subject: [PATCH 048/152] add Comments in ShopCommand.java --- src/main/java/org/bitbiome/commands/ShopCommand.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/bitbiome/commands/ShopCommand.java b/src/main/java/org/bitbiome/commands/ShopCommand.java index b718926..7b53bb3 100644 --- a/src/main/java/org/bitbiome/commands/ShopCommand.java +++ b/src/main/java/org/bitbiome/commands/ShopCommand.java @@ -3,7 +3,6 @@ package org.bitbiome.commands; import org.bitbiome.shop.Item; import org.bitbiome.shop.Shop; -import java.io.IOException; import java.util.ArrayList; import java.util.Scanner; @@ -19,7 +18,7 @@ public class ShopCommand implements CommandAPI{ System.out.println("Willkommen im Shop!"); ArrayList currentItems = shop.loadCurrentShopItems(); - + //whileloop for userinputs in the shop while (true){ System.out.println("Was willst Du hier im Shop?"); System.out.println("Etwas kaufen: 1"); @@ -43,8 +42,12 @@ public class ShopCommand implements CommandAPI{ if((Integer.parseInt(amount) <= currentItems.get(Integer.parseInt(itemNumber) - 1).amount) && ((Integer.parseInt(amount) - 1) > -1)){ boolean bool = shop.buy(currentItems.get(Integer.parseInt(itemNumber) - 1).name, Integer.parseInt(amount)); currentItems = shop.loadCurrentShopItems(); - System.out.println(""); - System.out.println("Vielen Dank für Ihren Einkauf!"); + if(bool){ + System.out.println(""); + System.out.println("Vielen Dank für Ihren Einkauf!"); + }else{ + System.out.println("Fehler"); + } }else{ System.out.println("Fehler"); } From ec8fd8524be0d7d1e699b1f9986b628b1f1dfd16 Mon Sep 17 00:00:00 2001 From: Max Gerbeth Date: Fri, 20 Jan 2023 00:14:36 +0100 Subject: [PATCH 049/152] remove unused import in Shop.java --- src/main/java/org/bitbiome/shop/Shop.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/java/org/bitbiome/shop/Shop.java b/src/main/java/org/bitbiome/shop/Shop.java index 3491896..68aaef3 100644 --- a/src/main/java/org/bitbiome/shop/Shop.java +++ b/src/main/java/org/bitbiome/shop/Shop.java @@ -5,7 +5,6 @@ import org.json.JSONObject; import java.io.File; import java.io.FileWriter; -import java.io.IOException; import java.nio.file.Files; import java.nio.file.Paths; import java.util.ArrayList; From b99ac6da82ebfd40de30c571fea050dc6043cbd0 Mon Sep 17 00:00:00 2001 From: Max Gerbeth Date: Fri, 20 Jan 2023 00:16:18 +0100 Subject: [PATCH 050/152] indend code in Shop.java --- src/main/java/org/bitbiome/shop/Shop.java | 51 ++++++++++++----------- 1 file changed, 26 insertions(+), 25 deletions(-) diff --git a/src/main/java/org/bitbiome/shop/Shop.java b/src/main/java/org/bitbiome/shop/Shop.java index 68aaef3..3ca1b22 100644 --- a/src/main/java/org/bitbiome/shop/Shop.java +++ b/src/main/java/org/bitbiome/shop/Shop.java @@ -172,32 +172,33 @@ public class Shop { private ArrayList loadPartofItems(ArrayList alleItems, int itemCount) { ArrayList arrayList = new ArrayList(); try{ - File fileGameConfig = new File("src/main/resources/gameconfig.json"); - String content2 = new String(Files.readAllBytes(Paths.get(fileGameConfig.toURI())), "UTF-8"); - JSONObject gameConfig = new JSONObject(content2); - - JSONArray jsonArray = gameConfig.getJSONArray("shopitems"); - HashSet hashSet = new HashSet<>(); - JSONArray shopitems = new JSONArray(); - Random random = new Random(); - while (hashSet.size() < itemCount){ - int rand = random.nextInt(alleItems.size()); - if(!hashSet.contains(rand)){ - hashSet.add(rand); - arrayList.add(alleItems.get(rand)); - JSONObject jsonObject = new JSONObject(); - jsonObject.put("name", alleItems.get(rand).name); - jsonObject.put("amount", alleItems.get(rand).amount); - jsonObject.put("gold", alleItems.get(rand).gold); - shopitems.put(jsonObject); + File fileGameConfig = new File("src/main/resources/gameconfig.json"); + String content2 = new String(Files.readAllBytes(Paths.get(fileGameConfig.toURI())), "UTF-8"); + JSONObject gameConfig = new JSONObject(content2); + + JSONArray jsonArray = gameConfig.getJSONArray("shopitems"); + HashSet hashSet = new HashSet<>(); + JSONArray shopitems = new JSONArray(); + Random random = new Random(); + while (hashSet.size() < itemCount){ + int rand = random.nextInt(alleItems.size()); + if(!hashSet.contains(rand)){ + hashSet.add(rand); + arrayList.add(alleItems.get(rand)); + JSONObject jsonObject = new JSONObject(); + jsonObject.put("name", alleItems.get(rand).name); + jsonObject.put("amount", alleItems.get(rand).amount); + jsonObject.put("gold", alleItems.get(rand).gold); + shopitems.put(jsonObject); + } } - } - //write in gameconfig.json - gameConfig.remove("shopitems"); - gameConfig.put("shopitems", shopitems); - FileWriter fileWriter = new FileWriter("src/main/resources/gameconfig.json"); - fileWriter.write(gameConfig.toString()); - fileWriter.close(); + //write in gameconfig.json + gameConfig.remove("shopitems"); + gameConfig.put("shopitems", shopitems); + FileWriter fileWriter = new FileWriter("src/main/resources/gameconfig.json"); + fileWriter.write(gameConfig.toString()); + fileWriter.close(); + }catch (Exception e){ e.printStackTrace(); } From 8a7eb010ab9eaba9c9e86905a2ef8bcbe879cd64 Mon Sep 17 00:00:00 2001 From: Max Gerbeth Date: Fri, 20 Jan 2023 00:18:11 +0100 Subject: [PATCH 051/152] typo in ShopCommand.java --- src/main/java/org/bitbiome/commands/ShopCommand.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/bitbiome/commands/ShopCommand.java b/src/main/java/org/bitbiome/commands/ShopCommand.java index 7b53bb3..bb51f52 100644 --- a/src/main/java/org/bitbiome/commands/ShopCommand.java +++ b/src/main/java/org/bitbiome/commands/ShopCommand.java @@ -28,7 +28,7 @@ public class ShopCommand implements CommandAPI{ String input = scanner.nextLine(); if(validInput(input)){ if(input.equals("1")){ - System.out.println("Folgende sind folgende Items im Shop: "); + System.out.println("Folgende Items sind im Shop: "); for(int i = 0; i < currentItems.size(); i++){ System.out.println((i + 1) + ". " + currentItems.get(i).name + " | Anzahl: " + currentItems.get(i).amount + " | Gold: " + currentItems.get(i).gold); } From 6cb6e42462cd05005bb1a9a1482c3c76c34be24d Mon Sep 17 00:00:00 2001 From: Max Gerbeth Date: Mon, 23 Jan 2023 11:04:36 +0100 Subject: [PATCH 052/152] add README.md --- README.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/README.md b/README.md index e69de29..7cde44a 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,28 @@ + + +--- +# BitBiome - TextAdventure +## What is the game about? +BitBiome is an exciting text adventure. Whether you want to travel through exciting biomes or measure with dangerous opponents. You can prove your knowledge in a quiz and buy new items in the shop as a reward. +BitBiome is a game for everyone who likes dangerous adventures. + +## Commands: +- help +- exit / quit +- quiz +- quitquiz / canclequiz +- shop +- travel +- location + +## Our Team members: +- David Hermann +- Julia Kunze +- Frederike von Gruben +- Philipp Völler +- Tanja Herche +- Max Gerbeth + +--- + +*Fulda University of Applied Sciences - Applied Computer Science (#AI1001 Papendieck)* From 99fd247d409ea4b138c6ccbb446f0c26ef6285de Mon Sep 17 00:00:00 2001 From: Max Gerbeth Date: Tue, 24 Jan 2023 16:52:09 +0100 Subject: [PATCH 053/152] using JsonPaser for writing in the file --- .../org/bitbiome/classes/InteractionLoop.java | 1 + .../bitbiome/commands/CommandListener.java | 6 ++++-- .../org/bitbiome/commands/ShopCommand.java | 3 ++- src/main/java/org/bitbiome/shop/Shop.java | 19 +++++++------------ 4 files changed, 14 insertions(+), 15 deletions(-) diff --git a/src/main/java/org/bitbiome/classes/InteractionLoop.java b/src/main/java/org/bitbiome/classes/InteractionLoop.java index 2523644..1d73075 100644 --- a/src/main/java/org/bitbiome/classes/InteractionLoop.java +++ b/src/main/java/org/bitbiome/classes/InteractionLoop.java @@ -1,6 +1,7 @@ package org.bitbiome.classes; import org.bitbiome.Boot; +import org.bitbiome.classes.*; import org.json.JSONObject; import java.util.Scanner; diff --git a/src/main/java/org/bitbiome/commands/CommandListener.java b/src/main/java/org/bitbiome/commands/CommandListener.java index 8677e64..14020fe 100644 --- a/src/main/java/org/bitbiome/commands/CommandListener.java +++ b/src/main/java/org/bitbiome/commands/CommandListener.java @@ -1,5 +1,7 @@ package org.bitbiome.commands; +import org.bitbiome.classes.TravelEngine; + import java.util.HashMap; import java.util.Scanner; @@ -24,11 +26,11 @@ public class CommandListener { } - public boolean perform(String command, Scanner scanner, boolean isRunning, String message) { + public boolean perform(String command, Scanner scanner, boolean isRunning, String message, TravelEngine travelEngine) { CommandAPI cmd; if ((cmd = commands.get(command)) != null) { - cmd.performCommand(scanner, isRunning, message); + cmd.performCommand(scanner, isRunning, message, travelEngine); return true; } return false; diff --git a/src/main/java/org/bitbiome/commands/ShopCommand.java b/src/main/java/org/bitbiome/commands/ShopCommand.java index bb51f52..25fbf4d 100644 --- a/src/main/java/org/bitbiome/commands/ShopCommand.java +++ b/src/main/java/org/bitbiome/commands/ShopCommand.java @@ -1,5 +1,6 @@ package org.bitbiome.commands; +import org.bitbiome.classes.TravelEngine; import org.bitbiome.shop.Item; import org.bitbiome.shop.Shop; @@ -14,7 +15,7 @@ public class ShopCommand implements CommandAPI{ } @Override - public void performCommand(Scanner scanner, boolean isRunning, String message) { + public void performCommand(Scanner scanner, boolean isRunning, String message, TravelEngine travelEngine) { System.out.println("Willkommen im Shop!"); ArrayList currentItems = shop.loadCurrentShopItems(); diff --git a/src/main/java/org/bitbiome/shop/Shop.java b/src/main/java/org/bitbiome/shop/Shop.java index 3ca1b22..9fa4d3d 100644 --- a/src/main/java/org/bitbiome/shop/Shop.java +++ b/src/main/java/org/bitbiome/shop/Shop.java @@ -1,5 +1,6 @@ package org.bitbiome.shop; +import org.bitbiome.classes.JsonParser; import org.json.JSONArray; import org.json.JSONObject; @@ -14,6 +15,7 @@ import java.util.Random; public class Shop { public ArrayList allItems; public ArrayList currentShopItems; + public JsonParser jsonParser = new JsonParser(); public Shop() { try { @@ -79,9 +81,7 @@ public class Shop { tempJSON.put("amount", intNewAmount); jsonArray2.put(tempJSON); gameConfig.put("shopitems", jsonArray2); - FileWriter fileWriter = new FileWriter("src/main/resources/gameconfig.json"); - fileWriter.write(gameConfig.toString()); - fileWriter.close(); + jsonParser.writeObject("gameconfig.json", gameConfig); currentShopItems = loadCurrentShopItems(); break; } @@ -98,9 +98,7 @@ public class Shop { tempJSON.put("amount", newAmount); jsonArray.put(tempJSON); playerConfig.put("inventory", jsonArray); - FileWriter fileWriter = new FileWriter("src/main/resources/playerconfig.json"); - fileWriter.write(playerConfig.toString()); - fileWriter.close(); + jsonParser.writeObject("playerconfig.json", playerConfig); return true; } } @@ -121,9 +119,7 @@ public class Shop { jsonArray.put(inventory); playerConfig.put("inventory", jsonArray); - FileWriter fileWriter = new FileWriter("src/main/resources/playerconfig.json"); - fileWriter.write(playerConfig.toString()); - fileWriter.close(); + jsonParser.writeObject("playerconfig.json", playerConfig); }catch (Exception e){ e.printStackTrace(); @@ -195,9 +191,8 @@ public class Shop { //write in gameconfig.json gameConfig.remove("shopitems"); gameConfig.put("shopitems", shopitems); - FileWriter fileWriter = new FileWriter("src/main/resources/gameconfig.json"); - fileWriter.write(gameConfig.toString()); - fileWriter.close(); + jsonParser.writeObject("gameconfig.json", gameConfig); + }catch (Exception e){ e.printStackTrace(); From 6d837c934c5acf0ab86c2c52d577cd7ef6666240 Mon Sep 17 00:00:00 2001 From: Max Gerbeth Date: Tue, 24 Jan 2023 17:08:02 +0100 Subject: [PATCH 054/152] adding Colors to prints on the console --- .../org/bitbiome/commands/ShopCommand.java | 30 +++++++++++-------- src/main/java/org/bitbiome/shop/Shop.java | 7 +++-- 2 files changed, 22 insertions(+), 15 deletions(-) diff --git a/src/main/java/org/bitbiome/commands/ShopCommand.java b/src/main/java/org/bitbiome/commands/ShopCommand.java index 25fbf4d..918707f 100644 --- a/src/main/java/org/bitbiome/commands/ShopCommand.java +++ b/src/main/java/org/bitbiome/commands/ShopCommand.java @@ -1,5 +1,6 @@ package org.bitbiome.commands; +import org.bitbiome.classes.Colors; import org.bitbiome.classes.TravelEngine; import org.bitbiome.shop.Item; import org.bitbiome.shop.Shop; @@ -16,7 +17,7 @@ public class ShopCommand implements CommandAPI{ @Override public void performCommand(Scanner scanner, boolean isRunning, String message, TravelEngine travelEngine) { - System.out.println("Willkommen im Shop!"); + System.out.println(Colors.ANSI_BG_YELLOW + Colors.ANSI_BLACK + "Willkommen im Shop!" + Colors.ANSI_RESET); ArrayList currentItems = shop.loadCurrentShopItems(); //whileloop for userinputs in the shop @@ -37,20 +38,25 @@ public class ShopCommand implements CommandAPI{ System.out.println(""); System.out.print("Welches Item moechtest du kaufen? "); String itemNumber = scanner.nextLine(); - if(!itemNumber.equals("0")){ + if(!itemNumber.equals("0")) { System.out.print("Anzahl eingeben: "); String amount = scanner.nextLine(); - if((Integer.parseInt(amount) <= currentItems.get(Integer.parseInt(itemNumber) - 1).amount) && ((Integer.parseInt(amount) - 1) > -1)){ - boolean bool = shop.buy(currentItems.get(Integer.parseInt(itemNumber) - 1).name, Integer.parseInt(amount)); - currentItems = shop.loadCurrentShopItems(); - if(bool){ - System.out.println(""); - System.out.println("Vielen Dank für Ihren Einkauf!"); - }else{ - System.out.println("Fehler"); + try { + if ((Integer.parseInt(amount) <= currentItems.get(Integer.parseInt(itemNumber) - 1).amount) && ((Integer.parseInt(amount) - 1) > -1)) { + boolean bool = shop.buy(currentItems.get(Integer.parseInt(itemNumber) - 1).name, Integer.parseInt(amount)); + currentItems = shop.loadCurrentShopItems(); + if (bool) { + System.out.println(""); + System.out.println(Colors.ANSI_BG_GREEN + Colors.ANSI_BLACK + "Vielen Dank für Ihren Einkauf!" + Colors.ANSI_RESET); + System.out.println(""); + } else { + System.out.println(Colors.ANSI_BG_RED + Colors.ANSI_BLACK + "Fehler!" + Colors.ANSI_RESET); + } + } else { + System.out.println(Colors.ANSI_BG_RED + Colors.ANSI_BLACK + "Fehler!" + Colors.ANSI_RESET); } - }else{ - System.out.println("Fehler"); + }catch (Exception e){ + System.out.println(Colors.ANSI_BG_RED + Colors.ANSI_BLACK + "Fehler!h" + Colors.ANSI_RESET); } } } else if(input.equals("2")){ diff --git a/src/main/java/org/bitbiome/shop/Shop.java b/src/main/java/org/bitbiome/shop/Shop.java index 9fa4d3d..9bcd1d9 100644 --- a/src/main/java/org/bitbiome/shop/Shop.java +++ b/src/main/java/org/bitbiome/shop/Shop.java @@ -1,5 +1,6 @@ package org.bitbiome.shop; +import org.bitbiome.classes.Colors; import org.bitbiome.classes.JsonParser; import org.json.JSONArray; import org.json.JSONObject; @@ -51,18 +52,18 @@ public class Shop { } } if(itemIndex == -1){ - System.out.println("Dieses Item gibt es nicht"); + System.out.println(Colors.ANSI_BG_RED + Colors.ANSI_BLACK + "Dieses Item gibt es nicht!" + Colors.ANSI_RESET); return false; } if(!(currentShopItems.get(itemIndex).amount > 0)){ - System.out.println("Es gibt zu wenige Items"); + System.out.println(Colors.ANSI_BG_RED + Colors.ANSI_BLACK + "Es gibt zu wenige Items!" + Colors.ANSI_RESET); return false; } //Test if the player has enough gold int costs = currentShopItems.get(itemIndex).gold * amount; int gold = (int) playerConfig.get("gold"); if(!(gold >= costs)){ - System.out.println("Du hast zu wenig Gold!"); + System.out.println(Colors.ANSI_BG_RED + Colors.ANSI_BLACK + "Du hast zu wenig Gold!" + Colors.ANSI_RESET); return false; } From f5784b40d22e750c9662432d8e5979c6a82ac93d Mon Sep 17 00:00:00 2001 From: Max Gerbeth Date: Wed, 25 Jan 2023 09:41:53 +0100 Subject: [PATCH 055/152] refactoring: ShopCommand.java --- README.md | 5 ++--- src/main/java/org/bitbiome/commands/ShopCommand.java | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 7cde44a..f39622f 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,4 @@ - - +*Hier Logo* --- # BitBiome - TextAdventure ## What is the game about? @@ -15,7 +14,7 @@ BitBiome is a game for everyone who likes dangerous adventures. - travel - location -## Our Team members: +## Our developers: - David Hermann - Julia Kunze - Frederike von Gruben diff --git a/src/main/java/org/bitbiome/commands/ShopCommand.java b/src/main/java/org/bitbiome/commands/ShopCommand.java index 918707f..1beb579 100644 --- a/src/main/java/org/bitbiome/commands/ShopCommand.java +++ b/src/main/java/org/bitbiome/commands/ShopCommand.java @@ -56,7 +56,7 @@ public class ShopCommand implements CommandAPI{ System.out.println(Colors.ANSI_BG_RED + Colors.ANSI_BLACK + "Fehler!" + Colors.ANSI_RESET); } }catch (Exception e){ - System.out.println(Colors.ANSI_BG_RED + Colors.ANSI_BLACK + "Fehler!h" + Colors.ANSI_RESET); + System.out.println(Colors.ANSI_BG_RED + Colors.ANSI_BLACK + "Fehler!" + Colors.ANSI_RESET); } } } else if(input.equals("2")){ From e10321a9c2aa345752383e4140d3a949f26ca818 Mon Sep 17 00:00:00 2001 From: Max Gerbeth Date: Mon, 30 Jan 2023 10:16:01 +0100 Subject: [PATCH 056/152] unittest: testSubtractGold16() --- src/test/java/org/bitbiome/commands/ShopCommandTest.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/test/java/org/bitbiome/commands/ShopCommandTest.java b/src/test/java/org/bitbiome/commands/ShopCommandTest.java index 54b35c1..34b7330 100755 --- a/src/test/java/org/bitbiome/commands/ShopCommandTest.java +++ b/src/test/java/org/bitbiome/commands/ShopCommandTest.java @@ -71,4 +71,11 @@ public class ShopCommandTest { int result = shop.subtractGold(20, 10); assertEquals(expected, result); } + + @Test + public void testSubtractGold6(){ + int expected = 12; + int result = shop.subtractGold(24, 12); + assertEquals(expected, result); + } } From 8407682f169e624b51ef258c3a19e85043720fc6 Mon Sep 17 00:00:00 2001 From: Max Gerbeth Date: Mon, 30 Jan 2023 10:17:08 +0100 Subject: [PATCH 057/152] unittest: testSubtractGold17() --- src/test/java/org/bitbiome/commands/ShopCommandTest.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/test/java/org/bitbiome/commands/ShopCommandTest.java b/src/test/java/org/bitbiome/commands/ShopCommandTest.java index 34b7330..d80674d 100755 --- a/src/test/java/org/bitbiome/commands/ShopCommandTest.java +++ b/src/test/java/org/bitbiome/commands/ShopCommandTest.java @@ -78,4 +78,10 @@ public class ShopCommandTest { int result = shop.subtractGold(24, 12); assertEquals(expected, result); } + @Test + public void testSubtractGold7(){ + int expected = 15; + int result = shop.subtractGold(31, 16); + assertEquals(expected, result); + } } From ce6247312e943b4e1d1eae3a62594745aef06ca1 Mon Sep 17 00:00:00 2001 From: David Hermann Date: Wed, 1 Feb 2023 19:43:06 +0100 Subject: [PATCH 058/152] Update Item.java Changed the privacy of the variables Added empty constructor for unit tests --- src/main/java/org/bitbiome/entities/Item.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/bitbiome/entities/Item.java b/src/main/java/org/bitbiome/entities/Item.java index 2817cd5..0ded3ff 100644 --- a/src/main/java/org/bitbiome/entities/Item.java +++ b/src/main/java/org/bitbiome/entities/Item.java @@ -2,9 +2,9 @@ package org.bitbiome.entities; public class Item { - public String name; - public boolean doesDamage; - public float damage; + private String name; + private boolean doesDamage; + private float damage; public Item(String name, boolean doesDamage, float damage) { @@ -13,6 +13,10 @@ public class Item { this.damage = damage; } + public Item() { + + } + public String getName() { return name; } From 5e723f41b3afbc014dfc3aedfb4d6b0259444cb6 Mon Sep 17 00:00:00 2001 From: David Hermann Date: Wed, 1 Feb 2023 19:43:27 +0100 Subject: [PATCH 059/152] Update Location.java Added empty constructor for unit tests Added setName() method for unit tests --- src/main/java/org/bitbiome/entities/Location.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/java/org/bitbiome/entities/Location.java b/src/main/java/org/bitbiome/entities/Location.java index 98c04d1..664509d 100644 --- a/src/main/java/org/bitbiome/entities/Location.java +++ b/src/main/java/org/bitbiome/entities/Location.java @@ -15,6 +15,10 @@ public class Location { this.itemList = itemList; } + public Location() { + + } + public String getName() { return name; @@ -28,6 +32,10 @@ public class Location { return itemList; } + public void setName(String name) { + this.name = name; + } + } From 7131083fd9a97e583ea3542b49452c3c5233dda3 Mon Sep 17 00:00:00 2001 From: David Hermann Date: Wed, 1 Feb 2023 19:43:46 +0100 Subject: [PATCH 060/152] Update Mob.java Added empty constructor for unit tests --- src/main/java/org/bitbiome/entities/Mob.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/org/bitbiome/entities/Mob.java b/src/main/java/org/bitbiome/entities/Mob.java index af479ce..4bb0d03 100644 --- a/src/main/java/org/bitbiome/entities/Mob.java +++ b/src/main/java/org/bitbiome/entities/Mob.java @@ -15,6 +15,10 @@ public class Mob { this.damage = damage; } + public Mob() { + + } + public String getName() { return name; } From 62ddc0bd3ce33994843d12f2c29915f47e66dabc Mon Sep 17 00:00:00 2001 From: David Hermann Date: Wed, 1 Feb 2023 19:43:56 +0100 Subject: [PATCH 061/152] Update Player.java Added empty constructor for unit tests --- src/main/java/org/bitbiome/entities/Player.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/org/bitbiome/entities/Player.java b/src/main/java/org/bitbiome/entities/Player.java index ff8dffb..3d46e17 100644 --- a/src/main/java/org/bitbiome/entities/Player.java +++ b/src/main/java/org/bitbiome/entities/Player.java @@ -22,6 +22,10 @@ public class Player { inventory = new ArrayList<>(); } + public Player() { + + } + public String getName() { return name; } From 56fb3c546cb826871798f4688f1a62bfb91d5747 Mon Sep 17 00:00:00 2001 From: David Hermann Date: Wed, 1 Feb 2023 19:51:18 +0100 Subject: [PATCH 062/152] unittest: created test for item class This is testing the name of the item --- .../org/bitbiome/entitiesTest/ItemTest.java | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 src/test/java/org/bitbiome/entitiesTest/ItemTest.java diff --git a/src/test/java/org/bitbiome/entitiesTest/ItemTest.java b/src/test/java/org/bitbiome/entitiesTest/ItemTest.java new file mode 100644 index 0000000..56335cc --- /dev/null +++ b/src/test/java/org/bitbiome/entitiesTest/ItemTest.java @@ -0,0 +1,23 @@ +package org.bitbiome.entitiesTest; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import org.bitbiome.entities.Item; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + + +public class ItemTest { + + private static Item item; + + @BeforeAll + public static void setItem() { + item = new Item(); + item.setName("Unit"); + } + + @Test + public void testGetName() { + assertEquals("Unit", item.getName()); + } +} From 8a380d1ef3e81db1dd79392744fed716a4e0202b Mon Sep 17 00:00:00 2001 From: David Hermann Date: Wed, 1 Feb 2023 20:02:21 +0100 Subject: [PATCH 063/152] unittest: updated item test This additionally tests the damage of the items --- src/test/java/org/bitbiome/entitiesTest/ItemTest.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/test/java/org/bitbiome/entitiesTest/ItemTest.java b/src/test/java/org/bitbiome/entitiesTest/ItemTest.java index 56335cc..ef6093c 100644 --- a/src/test/java/org/bitbiome/entitiesTest/ItemTest.java +++ b/src/test/java/org/bitbiome/entitiesTest/ItemTest.java @@ -14,10 +14,16 @@ public class ItemTest { public static void setItem() { item = new Item(); item.setName("Unit"); + item.setDamage(12.5F); } @Test public void testGetName() { assertEquals("Unit", item.getName()); } + + @Test + public void testGetDamage() { + assertEquals(12.5, item.getDamage()); + } } From 432c37c27826acabcada79ed58222c9d7147af9f Mon Sep 17 00:00:00 2001 From: David Hermann Date: Wed, 1 Feb 2023 20:07:24 +0100 Subject: [PATCH 064/152] unittest: updated item test This additionally tests whether the item does any damage at all. --- src/test/java/org/bitbiome/entitiesTest/ItemTest.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/test/java/org/bitbiome/entitiesTest/ItemTest.java b/src/test/java/org/bitbiome/entitiesTest/ItemTest.java index ef6093c..4214043 100644 --- a/src/test/java/org/bitbiome/entitiesTest/ItemTest.java +++ b/src/test/java/org/bitbiome/entitiesTest/ItemTest.java @@ -1,5 +1,6 @@ package org.bitbiome.entitiesTest; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assumptions.assumeTrue; import org.bitbiome.entities.Item; import org.junit.jupiter.api.BeforeAll; @@ -15,6 +16,7 @@ public class ItemTest { item = new Item(); item.setName("Unit"); item.setDamage(12.5F); + item.changeDoesDamage(true); } @Test @@ -26,4 +28,11 @@ public class ItemTest { public void testGetDamage() { assertEquals(12.5, item.getDamage()); } + + @Test + public void testDoesDamage() { + boolean doesDamage = item.doesDamage(); + assumeTrue(item.getDamage() > 0); + assumeTrue(doesDamage); + } } From 562bd31373f758a280ac57165568509fa2a2910a Mon Sep 17 00:00:00 2001 From: David Hermann Date: Wed, 1 Feb 2023 20:09:20 +0100 Subject: [PATCH 065/152] unittest: created test for mob class This tests whether the mob is friendly --- .../org/bitbiome/entitiesTest/MobTest.java | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 src/test/java/org/bitbiome/entitiesTest/MobTest.java diff --git a/src/test/java/org/bitbiome/entitiesTest/MobTest.java b/src/test/java/org/bitbiome/entitiesTest/MobTest.java new file mode 100644 index 0000000..b11f4ce --- /dev/null +++ b/src/test/java/org/bitbiome/entitiesTest/MobTest.java @@ -0,0 +1,24 @@ +package org.bitbiome.entitiesTest; +import static org.junit.jupiter.api.Assertions.assertEquals; +import org.bitbiome.entities.Mob; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + + +public class MobTest { + + private static Mob mob; + + @BeforeAll + public static void setMob() { + mob = new Mob(); + mob.setFriendly(true); + } + + + @Test + public void testFriendly() { + assertEquals(mob.isFriendly(), true); + } + +} From 21f5b7d44c8dcec7a72ec3250f28e704654b54f5 Mon Sep 17 00:00:00 2001 From: David Hermann Date: Wed, 1 Feb 2023 20:11:05 +0100 Subject: [PATCH 066/152] unittest: updated mob test This additionally tests how much damage the mob does --- src/test/java/org/bitbiome/entitiesTest/MobTest.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/test/java/org/bitbiome/entitiesTest/MobTest.java b/src/test/java/org/bitbiome/entitiesTest/MobTest.java index b11f4ce..9777dc3 100644 --- a/src/test/java/org/bitbiome/entitiesTest/MobTest.java +++ b/src/test/java/org/bitbiome/entitiesTest/MobTest.java @@ -13,6 +13,7 @@ public class MobTest { public static void setMob() { mob = new Mob(); mob.setFriendly(true); + mob.setDamage(0F); } @@ -20,5 +21,10 @@ public class MobTest { public void testFriendly() { assertEquals(mob.isFriendly(), true); } + + @Test + public void testDamage() { + assertEquals(mob.getDamage(), 0F); + } } From 06c77bf83768ad7503e89ee9e176e6370d2503a8 Mon Sep 17 00:00:00 2001 From: David Hermann Date: Wed, 1 Feb 2023 20:11:44 +0100 Subject: [PATCH 067/152] unittest: updated mob test This additionally tests how much life the mob has --- src/test/java/org/bitbiome/entitiesTest/MobTest.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/test/java/org/bitbiome/entitiesTest/MobTest.java b/src/test/java/org/bitbiome/entitiesTest/MobTest.java index 9777dc3..00afaf8 100644 --- a/src/test/java/org/bitbiome/entitiesTest/MobTest.java +++ b/src/test/java/org/bitbiome/entitiesTest/MobTest.java @@ -14,6 +14,7 @@ public class MobTest { mob = new Mob(); mob.setFriendly(true); mob.setDamage(0F); + mob.setHp(561.45F); } @@ -27,4 +28,8 @@ public class MobTest { assertEquals(mob.getDamage(), 0F); } + @Test + public void testHp() { + assertEquals(mob.getHp(), 561.45F); + } } From 8dda2401d12e18fa0846eb44c00fdc7bfa8f6f34 Mon Sep 17 00:00:00 2001 From: David Hermann Date: Wed, 1 Feb 2023 20:12:44 +0100 Subject: [PATCH 068/152] unittest: created test for location class This tests the name of the location --- .../bitbiome/entitiesTest/LocationTest.java | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 src/test/java/org/bitbiome/entitiesTest/LocationTest.java diff --git a/src/test/java/org/bitbiome/entitiesTest/LocationTest.java b/src/test/java/org/bitbiome/entitiesTest/LocationTest.java new file mode 100644 index 0000000..1ae0575 --- /dev/null +++ b/src/test/java/org/bitbiome/entitiesTest/LocationTest.java @@ -0,0 +1,24 @@ +package org.bitbiome.entitiesTest; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import org.bitbiome.entities.Location; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +public class LocationTest { + + private static Location location; + + + @BeforeAll + public static void setLocation() { + location = new Location(); + location.setName("NewUnitWorld"); + } + + @Test + public void testLocationName() { + assertEquals("NewUnitWorld", location.getName()); + } +} From 9acf819d35f8df525d081dcd1d8992c28b79c0c0 Mon Sep 17 00:00:00 2001 From: David Hermann Date: Wed, 1 Feb 2023 20:13:52 +0100 Subject: [PATCH 069/152] unittest: created test for player class This tests the name of the player --- .../org/bitbiome/entitiesTest/PlayerTest.java | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 src/test/java/org/bitbiome/entitiesTest/PlayerTest.java diff --git a/src/test/java/org/bitbiome/entitiesTest/PlayerTest.java b/src/test/java/org/bitbiome/entitiesTest/PlayerTest.java new file mode 100644 index 0000000..4f9d885 --- /dev/null +++ b/src/test/java/org/bitbiome/entitiesTest/PlayerTest.java @@ -0,0 +1,26 @@ +package org.bitbiome.entitiesTest; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import org.bitbiome.entities.Player; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +public class PlayerTest { + + private static Player player; + + @BeforeAll + public static void setPlayer() { + player = new Player(); + + player.setName("UnitPlayer"); + + } + + @Test + public void testPlayerName() { + assertEquals("UnitPlayer", player.getName()); + } + +} From df4b960fa7532add54a912710539b03c2c86ae9d Mon Sep 17 00:00:00 2001 From: David Hermann Date: Wed, 1 Feb 2023 20:14:52 +0100 Subject: [PATCH 070/152] unittest: updated player test This additionally tests how many lives the player has --- src/test/java/org/bitbiome/entitiesTest/PlayerTest.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/test/java/org/bitbiome/entitiesTest/PlayerTest.java b/src/test/java/org/bitbiome/entitiesTest/PlayerTest.java index 4f9d885..df03dfd 100644 --- a/src/test/java/org/bitbiome/entitiesTest/PlayerTest.java +++ b/src/test/java/org/bitbiome/entitiesTest/PlayerTest.java @@ -15,7 +15,7 @@ public class PlayerTest { player = new Player(); player.setName("UnitPlayer"); - + player.setHp(100F); } @Test @@ -23,4 +23,10 @@ public class PlayerTest { assertEquals("UnitPlayer", player.getName()); } + + @Test + public void testPlayerHp() { + assertEquals(100F, player.getHp()); + } + } From 1ded07cd00b5145388665ee00836fa152cb14598 Mon Sep 17 00:00:00 2001 From: David Hermann Date: Wed, 1 Feb 2023 20:17:10 +0100 Subject: [PATCH 071/152] unittest: updated player test This additionally tests if the player has a location by testing the name of the location related to the player --- .../java/org/bitbiome/entitiesTest/PlayerTest.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/test/java/org/bitbiome/entitiesTest/PlayerTest.java b/src/test/java/org/bitbiome/entitiesTest/PlayerTest.java index df03dfd..2205e95 100644 --- a/src/test/java/org/bitbiome/entitiesTest/PlayerTest.java +++ b/src/test/java/org/bitbiome/entitiesTest/PlayerTest.java @@ -2,6 +2,7 @@ package org.bitbiome.entitiesTest; import static org.junit.jupiter.api.Assertions.assertEquals; +import org.bitbiome.entities.Location; import org.bitbiome.entities.Player; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; @@ -9,12 +10,17 @@ import org.junit.jupiter.api.Test; public class PlayerTest { private static Player player; + private static Location location; @BeforeAll public static void setPlayer() { player = new Player(); + location = new Location(); + + location.setName("NewUnitWorld"); player.setName("UnitPlayer"); + player.setLocation(location); player.setHp(100F); } @@ -29,4 +35,9 @@ public class PlayerTest { assertEquals(100F, player.getHp()); } + @Test + public void testLocationNameFromPlayer() { + assertEquals("NewUnitWorld", player.getLocation().getName()); + } + } From 083e9ae00e2908d86160df5a222a9d47ab26ed77 Mon Sep 17 00:00:00 2001 From: Friederike von Gruben Date: Wed, 1 Feb 2023 23:52:35 +0100 Subject: [PATCH 072/152] refactoring: Updated JsonParser Edited method name Now working with relative paths --- .../java/org/bitbiome/classes/JsonParser.java | 32 +++++++++++-------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/src/main/java/org/bitbiome/classes/JsonParser.java b/src/main/java/org/bitbiome/classes/JsonParser.java index 56a9535..66dc79c 100644 --- a/src/main/java/org/bitbiome/classes/JsonParser.java +++ b/src/main/java/org/bitbiome/classes/JsonParser.java @@ -2,13 +2,11 @@ package org.bitbiome.classes; import org.json.JSONObject; import org.json.JSONTokener; -import org.json.JSONWriter; +import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; import java.io.InputStream; -import java.io.StringWriter; - public class JsonParser { @@ -28,20 +26,30 @@ public class JsonParser { https://github.com/stleary/JSON-java */ - public static JSONObject getJSONObject(String fileName) { - String resourceName = "./../../" + fileName; - InputStream is = JsonParser.class.getResourceAsStream(resourceName); - if (is == null) { - throw new NullPointerException("Cannot find resource file " + resourceName); + public static JSONObject readJSONFile(String filePath) { + StringBuilder sb = null; + try { + FileReader reader = new FileReader(filePath); + char[] buffer = new char[1024]; + int length; + sb = new StringBuilder(); + while ((length = reader.read(buffer)) != -1) { + sb.append(buffer, 0, length); + } + + reader.close(); + + } catch (IOException e) { + System.out.println(e); } - JSONTokener tokener = new JSONTokener(is); - return new JSONObject(tokener); + return new JSONObject(sb.toString()); } public static void writeObject(String fileName, JSONObject object) { - String resourceName = System.getProperty("user.dir") + "/src/main/resources/" + fileName; + String resourceName = fileName; + try { FileWriter fw = new FileWriter(resourceName, false); fw.write(object.toString(1)); @@ -49,7 +57,5 @@ public class JsonParser { } catch (IOException e) { throw new RuntimeException(e); } - - } } From ed0debe9fa1b642d4f8ba2088336e6e0442f6297 Mon Sep 17 00:00:00 2001 From: Friederike von Gruben Date: Wed, 1 Feb 2023 23:54:17 +0100 Subject: [PATCH 073/152] Created new Command: Quiz --- .../org/bitbiome/commands/CommandListener.java | 1 + .../java/org/bitbiome/commands/QuizCommand.java | 14 ++++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 src/main/java/org/bitbiome/commands/QuizCommand.java diff --git a/src/main/java/org/bitbiome/commands/CommandListener.java b/src/main/java/org/bitbiome/commands/CommandListener.java index 2e62105..6465891 100644 --- a/src/main/java/org/bitbiome/commands/CommandListener.java +++ b/src/main/java/org/bitbiome/commands/CommandListener.java @@ -14,6 +14,7 @@ public class CommandListener { commands.put("exit", new QuitCommand()); commands.put("quit", new QuitCommand()); + commands.put("quiz", new QuizCommand()); } public HashMap returnCommands() { diff --git a/src/main/java/org/bitbiome/commands/QuizCommand.java b/src/main/java/org/bitbiome/commands/QuizCommand.java new file mode 100644 index 0000000..cdcf4e1 --- /dev/null +++ b/src/main/java/org/bitbiome/commands/QuizCommand.java @@ -0,0 +1,14 @@ +package org.bitbiome.commands; + + +import java.util.Scanner; + +public class QuizCommand implements CommandAPI { + + @Override + public void performCommand(Scanner scanner, boolean isRunning, String message) { + + } +} + + From cb3c5b402e391321c49b50b7224d5d42eebf772f Mon Sep 17 00:00:00 2001 From: Friederike von Gruben Date: Wed, 1 Feb 2023 23:56:49 +0100 Subject: [PATCH 074/152] refactoring: Updated Json File Added lastPlayed keyword --- src/main/resources/quiz.json | 405 ++++++++++++++++++----------------- 1 file changed, 203 insertions(+), 202 deletions(-) diff --git a/src/main/resources/quiz.json b/src/main/resources/quiz.json index cc58a3f..a36366a 100644 --- a/src/main/resources/quiz.json +++ b/src/main/resources/quiz.json @@ -1,204 +1,205 @@ { - "Quiz": [ - { - "frage": "Wie lang ist der Äquator der Erde?", - "antworten": [ - "20.000m", - "30km", - "60.000km", - "40.000km" - ], - "korrekteAntwort": "40.000km" - }, - { - "frage": "Was ist der längste Fluss der Welt?", - "antworten": [ - "Amazonas", - "Nil", - "Rhein", - "Niger" - ], - "korrekteAntwort": "Nil" - }, - { - "frage": "Wie viele Tasten hat ein Klavier?", - "antworten": [ - "74", - "86", - "82", - "88" - ], - "korrekteAntwort": "88" - }, - { - "frage": "Von wem wird der Bundespräsident gewählt?", - "antworten": [ - "Vom Europäischen Parlament", - "Vom Bundeskanzler", - "Vom Bundestag", - "Von der Bundesversammlung" - ], - "korrekteAntwort": "von der Bundesversammlung" - }, - { - "frage": "Welches Land produziert jährlich die meisten Filme?", - "antworten": [ - "USA", - "Indien", - "Japan", - "Nigeria" - ], - "korrekteAntwort": "Indien" - }, - { - "frage": "Wie heißt der am schnellsten schwimmende Fisch auf Erden?", - "antworten": [ - "Flugfisch", - "Tigerhai", - "Segelfisch", - "Windfisch" - ], - "korrekteAntwort": "Segelfisch" - }, - { - "frage": "Was ist KEIN Gewächs?", - "antworten": [ - "Geranie", - "Moosfarn", - "Incolornis", - "Strandflieder" - ], - "korrekteAntwort": "Incolornis" - }, - { - "frage": "Was nutzt eine Fledermaus zur Orientierung in der Luft?", - "antworten": [ - "Infrarot", - "Röntgenstrahlen", - "Speichel", - "Ultraschall" - ], - "korrekteAntwort": "Ultraschall" - }, - { - "frage": "Von wem stammt der berühmte Satz: 'Ich denke, also bin ich'?", - "antworten": [ - "John Fitzgerald Kennedy", - "George Walker Bush", - "René Descartes", - "Julius Caesar" - ], - "korrekteAntwort": "René Descartes" - }, - { - "frage": "Welches Lebensmittel enthält das meiste Wasser?", - "antworten": [ - "Gurke", - "Wassermelone", - "Zitrone", - "Paprika" - ], - "korrekteAntwort": "Gurke" - }, - { - "frage": "Welches Lebensmittel gehört im botanischen Sinne zu den Früchten?", - "antworten": [ - "Möhre", - "Kartoffel", - "Tomate", - "Weißkohl" - ], - "korrekteAntwort": "Tomate" - }, - { - "frage": "Haptische Wahrnehmung beruht auf dem...?", - "antworten": [ - "Greifreflex", - "Gleichgewichtssinn", - "Hörsinn", - "Tastsinn" - ], - "korrekteAntwort": "Tastsinn" - }, - { - "frage": "Wie nennt man den letzten Tanz einer Tanzveranstaltung?", - "antworten": [ - "Voraus", - "Garaus", - "Kehraus", - "Durchaus" - ], - "korrekteAntwort": "Kehraus" - }, - { - "frage": "Wie nennt man ein tiefes, enges Tal, durch das ein Gebirgsbach fließt?", - "antworten": [ - "Klamm", - "Feucht", - "Nass", - "Schwamm" - ], - "korrekteAntwort": "Klamm" - }, - { - "frage": "Wer oder was ist Gerbera?", - "antworten": [ - "eine europäische Landschaft", - "eine Pflanze", - "die erste Präsidentin von Südafrika", - "eine Stadt in Lichtenstein" - ], - "korrekteAntwort": "eine Pflanze" - }, - { - "frage": "Nach wem wurde ein Gesellschaftsanzug benannt?", - "antworten": [ - "Richard von Weizsäcker", - "Gustav Heinemann", - "Jürgen Klinsmann", - "Gustav Stresemann" - ], - "korrekteAntwort": "Gustav Stresemann" - }, - { - "frage": "Was ist Speckstein?", - "antworten": [ - "eine Fischart, die sich als Stein tarnt", - "ein Gericht aus dem Mittelalter", - "eine Skulptur im Römischen Reich unter Nero", - "ein besonders weicher Stein" - ], - "korrekteAntwort": "ein besonders weicher Stein" - }, - { - "frage": "In welcher Religion gibt es Gurus?", - "antworten": [ - "im Christentum", - "im Hinduismus", - "im Islam", - "im Judentum" - ], - "korrekteAntwort": "im Hinduismus" - }, - { - "frage": "Was versteht man unter Brunsbüttel?", - "antworten": [ - "eine Industriestadt an der Unterelbe", - "einen Plakatkleber", - "eine 630 Mark-Kraft", - "ein Staatssekretär" - ], - "korrekteAntwort": "eine Industriestadt an der Unterelbe" - }, - { - "frage": "Welcher im 11. Jahrhundert gegründeter Orden rettet und pfelgt auch noch heute Verletzte und Kranke?", - "antworten": [ - "die Dominikaner", - "die Augustiner", - "die Zisterzienser", - "die Johanniter" - ], - "korrekteAntwort": "die Johanniter" - } - ] + "Quiz": [ + { + "frage": "Wie lang ist der Äquator der Erde?", + "korrekteAntwort": "40.000km", + "antworten": [ + "20.000m", + "30km", + "60.000km", + "40.000km" + ] + }, + { + "frage": "Was ist der längste Fluss der Welt?", + "korrekteAntwort": "Nil", + "antworten": [ + "Amazonas", + "Nil", + "Rhein", + "Niger" + ] + }, + { + "frage": "Wie viele Tasten hat ein Klavier?", + "korrekteAntwort": "88", + "antworten": [ + "74", + "86", + "82", + "88" + ] + }, + { + "frage": "Von wem wird der Bundespräsident gewählt?", + "korrekteAntwort": "von der Bundesversammlung", + "antworten": [ + "Vom Europäischen Parlament", + "Vom Bundeskanzler", + "Vom Bundestag", + "Von der Bundesversammlung" + ] + }, + { + "frage": "Welches Land produziert jährlich die meisten Filme?", + "korrekteAntwort": "Indien", + "antworten": [ + "USA", + "Indien", + "Japan", + "Nigeria" + ] + }, + { + "frage": "Wie heißt der am schnellsten schwimmende Fisch auf Erden?", + "korrekteAntwort": "Segelfisch", + "antworten": [ + "Flugfisch", + "Tigerhai", + "Segelfisch", + "Windfisch" + ] + }, + { + "frage": "Was ist KEIN Gewächs?", + "korrekteAntwort": "Incolornis", + "antworten": [ + "Geranie", + "Moosfarn", + "Incolornis", + "Strandflieder" + ] + }, + { + "frage": "Was nutzt eine Fledermaus zur Orientierung in der Luft?", + "korrekteAntwort": "Ultraschall", + "antworten": [ + "Infrarot", + "Röntgenstrahlen", + "Speichel", + "Ultraschall" + ] + }, + { + "frage": "Von wem stammt der berühmte Satz: 'Ich denke, also bin ich'?", + "korrekteAntwort": "René Descartes", + "antworten": [ + "John Fitzgerald Kennedy", + "George Walker Bush", + "René Descartes", + "Julius Caesar" + ] + }, + { + "frage": "Welches Lebensmittel enthält das meiste Wasser?", + "korrekteAntwort": "Gurke", + "antworten": [ + "Gurke", + "Wassermelone", + "Zitrone", + "Paprika" + ] + }, + { + "frage": "Welches Lebensmittel gehört im botanischen Sinne zu den Früchten?", + "korrekteAntwort": "Tomate", + "antworten": [ + "Möhre", + "Kartoffel", + "Tomate", + "Weißkohl" + ] + }, + { + "frage": "Haptische Wahrnehmung beruht auf dem...?", + "korrekteAntwort": "Tastsinn", + "antworten": [ + "Greifreflex", + "Gleichgewichtssinn", + "Hörsinn", + "Tastsinn" + ] + }, + { + "frage": "Wie nennt man den letzten Tanz einer Tanzveranstaltung?", + "korrekteAntwort": "Kehraus", + "antworten": [ + "Voraus", + "Garaus", + "Kehraus", + "Durchaus" + ] + }, + { + "frage": "Wie nennt man ein tiefes, enges Tal, durch das ein Gebirgsbach fließt?", + "korrekteAntwort": "Klamm", + "antworten": [ + "Klamm", + "Feucht", + "Nass", + "Schwamm" + ] + }, + { + "frage": "Wer oder was ist Gerbera?", + "korrekteAntwort": "eine Pflanze", + "antworten": [ + "eine europäische Landschaft", + "eine Pflanze", + "die erste Präsidentin von Südafrika", + "eine Stadt in Lichtenstein" + ] + }, + { + "frage": "Nach wem wurde ein Gesellschaftsanzug benannt?", + "korrekteAntwort": "Gustav Stresemann", + "antworten": [ + "Richard von Weizsäcker", + "Gustav Heinemann", + "Jürgen Klinsmann", + "Gustav Stresemann" + ] + }, + { + "frage": "Was ist Speckstein?", + "korrekteAntwort": "ein besonders weicher Stein", + "antworten": [ + "eine Fischart, die sich als Stein tarnt", + "ein Gericht aus dem Mittelalter", + "eine Skulptur im Römischen Reich unter Nero", + "ein besonders weicher Stein" + ] + }, + { + "frage": "In welcher Religion gibt es Gurus?", + "korrekteAntwort": "im Hinduismus", + "antworten": [ + "im Christentum", + "im Hinduismus", + "im Islam", + "im Judentum" + ] + }, + { + "frage": "Was versteht man unter Brunsbüttel?", + "korrekteAntwort": "eine Industriestadt an der Unterelbe", + "antworten": [ + "eine Industriestadt an der Unterelbe", + "einen Plakatkleber", + "eine 630 Mark-Kraft", + "ein Staatssekretär" + ] + }, + { + "frage": "Welcher im 11. Jahrhundert gegründeter Orden rettet und pfelgt auch noch heute Verletzte und Kranke?", + "korrekteAntwort": "die Johanniter", + "antworten": [ + "die Dominikaner", + "die Augustiner", + "die Zisterzienser", + "die Johanniter" + ] + } + ], + "lastPlayed": 0 } \ No newline at end of file From 803ed2f6fc67f6c4d90cefd6e91f6f6ab10667e3 Mon Sep 17 00:00:00 2001 From: Friederike von Gruben Date: Thu, 2 Feb 2023 00:19:13 +0100 Subject: [PATCH 075/152] Update QuizCommand.java Random question picked from json file and printed out with answeres --- .../org/bitbiome/commands/QuizCommand.java | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/main/java/org/bitbiome/commands/QuizCommand.java b/src/main/java/org/bitbiome/commands/QuizCommand.java index cdcf4e1..3d10aea 100644 --- a/src/main/java/org/bitbiome/commands/QuizCommand.java +++ b/src/main/java/org/bitbiome/commands/QuizCommand.java @@ -1,12 +1,35 @@ package org.bitbiome.commands; +import org.bitbiome.classes.JsonParser; +import org.json.JSONArray; +import org.json.JSONObject; + +import java.util.Random; import java.util.Scanner; public class QuizCommand implements CommandAPI { @Override public void performCommand(Scanner scanner, boolean isRunning, String message) { + String path = "src\\main\\resources\\quiz.json"; + JSONObject quiz = JsonParser.readJSONFile(path); + + JSONArray fragen = quiz.getJSONArray("Quiz"); + int index = new Random().nextInt(fragen.length()); + JSONObject frage = fragen.getJSONObject(index); + JSONArray antworten = frage.getJSONArray("antworten"); + + System.out.println("Du hast das Quiz gestartet! Hinweis: Wähle deine Antwort, indem du die Zahl (1-4) eingibst. Ist deine Lösung richtig, erhälst du 5 Münzen. Viel Erfolg! \n"); + + String frageString = frage.getString("frage"); + + System.out.println(frageString); + + for (int i = 0; i < antworten.length(); i++) { + String antwort = antworten.getString(i); + System.out.println(i + 1 + ". " + antwort); + } } } From 50784178b371185317fd58e3691e978acafcade0 Mon Sep 17 00:00:00 2001 From: Friederike von Gruben Date: Thu, 2 Feb 2023 00:26:42 +0100 Subject: [PATCH 076/152] Update QuizCommand.java Getting userinput and checking whether answer is correct --- src/main/java/org/bitbiome/commands/QuizCommand.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main/java/org/bitbiome/commands/QuizCommand.java b/src/main/java/org/bitbiome/commands/QuizCommand.java index 3d10aea..241917d 100644 --- a/src/main/java/org/bitbiome/commands/QuizCommand.java +++ b/src/main/java/org/bitbiome/commands/QuizCommand.java @@ -30,7 +30,17 @@ public class QuizCommand implements CommandAPI { String antwort = antworten.getString(i); System.out.println(i + 1 + ". " + antwort); } + Scanner quizScanner = new Scanner(System.in); + int eingabe = quizScanner.nextInt(); + String korrekteAntwort = frage.getString("korrekteAntwort"); + + if (antworten.getString(eingabe - 1).equalsIgnoreCase(korrekteAntwort)) { + System.out.println("Richtige Antwort!\n"); + } else { + System.out.println("Leider falsch... Richtig ist: " + korrekteAntwort + "\n"); + } + System.out.println("Das Quiz ist vorbei."); } } From 34c135d54c5477e250abbd58d46ea82cfc9c275e Mon Sep 17 00:00:00 2001 From: Friederike von Gruben Date: Thu, 2 Feb 2023 00:49:19 +0100 Subject: [PATCH 077/152] refactoring: Outsourced code Whether the answer is correct or not is outsourced now --- src/main/java/org/bitbiome/commands/QuizCommand.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/bitbiome/commands/QuizCommand.java b/src/main/java/org/bitbiome/commands/QuizCommand.java index 241917d..0088a6b 100644 --- a/src/main/java/org/bitbiome/commands/QuizCommand.java +++ b/src/main/java/org/bitbiome/commands/QuizCommand.java @@ -34,7 +34,7 @@ public class QuizCommand implements CommandAPI { int eingabe = quizScanner.nextInt(); String korrekteAntwort = frage.getString("korrekteAntwort"); - if (antworten.getString(eingabe - 1).equalsIgnoreCase(korrekteAntwort)) { + if (answerIsCorrect(eingabe, korrekteAntwort, antworten)) { System.out.println("Richtige Antwort!\n"); } else { System.out.println("Leider falsch... Richtig ist: " + korrekteAntwort + "\n"); @@ -42,6 +42,10 @@ public class QuizCommand implements CommandAPI { System.out.println("Das Quiz ist vorbei."); } + + public static boolean answerIsCorrect(int picked, String answer, JSONArray answers) { + return answers.getString(picked - 1).equalsIgnoreCase(answer); + } } From 37ad1c9b1ea6635916e983a2c37f062c57e6fb58 Mon Sep 17 00:00:00 2001 From: Friederike von Gruben Date: Thu, 2 Feb 2023 00:52:54 +0100 Subject: [PATCH 078/152] refactoring: Created print method This method is printing a messag to the console and returning the same message --- .../org/bitbiome/commands/QuizCommand.java | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/main/java/org/bitbiome/commands/QuizCommand.java b/src/main/java/org/bitbiome/commands/QuizCommand.java index 0088a6b..05eb2e8 100644 --- a/src/main/java/org/bitbiome/commands/QuizCommand.java +++ b/src/main/java/org/bitbiome/commands/QuizCommand.java @@ -20,32 +20,38 @@ public class QuizCommand implements CommandAPI { JSONObject frage = fragen.getJSONObject(index); JSONArray antworten = frage.getJSONArray("antworten"); - System.out.println("Du hast das Quiz gestartet! Hinweis: Wähle deine Antwort, indem du die Zahl (1-4) eingibst. Ist deine Lösung richtig, erhälst du 5 Münzen. Viel Erfolg! \n"); + print("Du hast das Quiz gestartet! Hinweis: Wähle deine Antwort, indem du die Zahl (1-4) eingibst. Ist deine Lösung richtig, erhälst du 5 Münzen. Viel Erfolg! \n"); String frageString = frage.getString("frage"); - System.out.println(frageString); + print(frageString); for (int i = 0; i < antworten.length(); i++) { String antwort = antworten.getString(i); - System.out.println(i + 1 + ". " + antwort); + print(i + 1 + ". " + antwort); } Scanner quizScanner = new Scanner(System.in); int eingabe = quizScanner.nextInt(); String korrekteAntwort = frage.getString("korrekteAntwort"); if (answerIsCorrect(eingabe, korrekteAntwort, antworten)) { - System.out.println("Richtige Antwort!\n"); + print("Richtige Antwort!\n"); } else { - System.out.println("Leider falsch... Richtig ist: " + korrekteAntwort + "\n"); + print("Leider falsch... Richtig ist: " + korrekteAntwort + "\n"); } - System.out.println("Das Quiz ist vorbei."); + print("Das Quiz ist vorbei."); } public static boolean answerIsCorrect(int picked, String answer, JSONArray answers) { return answers.getString(picked - 1).equalsIgnoreCase(answer); } + + public static String print(String message) { + System.out.println(message); + return message; + } + } From 96715d3f4372085d4ef555aff67aba163b17de2a Mon Sep 17 00:00:00 2001 From: Friederike von Gruben Date: Thu, 2 Feb 2023 00:57:24 +0100 Subject: [PATCH 079/152] refactoring: Edited code structure Outsourced the generating random number method --- .../org/bitbiome/commands/QuizCommand.java | 22 +++++++++++++------ 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/src/main/java/org/bitbiome/commands/QuizCommand.java b/src/main/java/org/bitbiome/commands/QuizCommand.java index 05eb2e8..d4c37dd 100644 --- a/src/main/java/org/bitbiome/commands/QuizCommand.java +++ b/src/main/java/org/bitbiome/commands/QuizCommand.java @@ -9,20 +9,24 @@ import java.util.Random; import java.util.Scanner; public class QuizCommand implements CommandAPI { - + private Scanner quizScanner; @Override public void performCommand(Scanner scanner, boolean isRunning, String message) { + quizScanner = new Scanner(System.in); + String path = "src\\main\\resources\\quiz.json"; JSONObject quiz = JsonParser.readJSONFile(path); JSONArray fragen = quiz.getJSONArray("Quiz"); - int index = new Random().nextInt(fragen.length()); - JSONObject frage = fragen.getJSONObject(index); - JSONArray antworten = frage.getJSONArray("antworten"); + JSONObject frage = fragen.getJSONObject(random(fragen.length())); - print("Du hast das Quiz gestartet! Hinweis: Wähle deine Antwort, indem du die Zahl (1-4) eingibst. Ist deine Lösung richtig, erhälst du 5 Münzen. Viel Erfolg! \n"); + JSONArray antworten = frage.getJSONArray("antworten"); String frageString = frage.getString("frage"); + String korrekteAntwort = frage.getString("korrekteAntwort"); + + + print("Du hast das Quiz gestartet! Hinweis: Wähle deine Antwort, indem du die Zahl (1-4) eingibst. Ist deine Lösung richtig, erhälst du 5 Münzen. Viel Erfolg! \n"); print(frageString); @@ -30,9 +34,9 @@ public class QuizCommand implements CommandAPI { String antwort = antworten.getString(i); print(i + 1 + ". " + antwort); } - Scanner quizScanner = new Scanner(System.in); + int eingabe = quizScanner.nextInt(); - String korrekteAntwort = frage.getString("korrekteAntwort"); + if (answerIsCorrect(eingabe, korrekteAntwort, antworten)) { print("Richtige Antwort!\n"); @@ -52,6 +56,10 @@ public class QuizCommand implements CommandAPI { return message; } + public static int random(int length) { + return new Random().nextInt(length); + } + } From c720c4836fe3b03c0f6fcd3db6e706c00f709271 Mon Sep 17 00:00:00 2001 From: Friederike von Gruben Date: Thu, 2 Feb 2023 01:03:43 +0100 Subject: [PATCH 080/152] refactoring: Outsourced Code Generating the question with possible answers now in outsourced method --- .../org/bitbiome/commands/QuizCommand.java | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/main/java/org/bitbiome/commands/QuizCommand.java b/src/main/java/org/bitbiome/commands/QuizCommand.java index d4c37dd..5748d7b 100644 --- a/src/main/java/org/bitbiome/commands/QuizCommand.java +++ b/src/main/java/org/bitbiome/commands/QuizCommand.java @@ -22,22 +22,15 @@ public class QuizCommand implements CommandAPI { JSONArray antworten = frage.getJSONArray("antworten"); - String frageString = frage.getString("frage"); - String korrekteAntwort = frage.getString("korrekteAntwort"); + String korrekteAntwort = frage.getString("korrekteAntwort"); print("Du hast das Quiz gestartet! Hinweis: Wähle deine Antwort, indem du die Zahl (1-4) eingibst. Ist deine Lösung richtig, erhälst du 5 Münzen. Viel Erfolg! \n"); - print(frageString); - - for (int i = 0; i < antworten.length(); i++) { - String antwort = antworten.getString(i); - print(i + 1 + ". " + antwort); - } + print(generateQuestion(frage, antworten)); int eingabe = quizScanner.nextInt(); - if (answerIsCorrect(eingabe, korrekteAntwort, antworten)) { print("Richtige Antwort!\n"); } else { @@ -60,6 +53,15 @@ public class QuizCommand implements CommandAPI { return new Random().nextInt(length); } + public static String generateQuestion(JSONObject frage, JSONArray answers) { + StringBuilder sb = new StringBuilder(); + sb.append(frage.getString("frage")).append("\n"); + for (int i = 0; i < answers.length(); i++) { + sb.append(i+1).append(". ").append(answers.getString(i)).append("\n"); + } + return sb.toString(); + } + } From 949d479d9ce1ed42a347ab9efc1f72f78489c4e9 Mon Sep 17 00:00:00 2001 From: Friederike von Gruben Date: Thu, 2 Feb 2023 01:07:10 +0100 Subject: [PATCH 081/152] Earn gold with quiz You can earn some gold with your quiz now --- src/main/java/org/bitbiome/commands/QuizCommand.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/bitbiome/commands/QuizCommand.java b/src/main/java/org/bitbiome/commands/QuizCommand.java index 5748d7b..2c1007d 100644 --- a/src/main/java/org/bitbiome/commands/QuizCommand.java +++ b/src/main/java/org/bitbiome/commands/QuizCommand.java @@ -32,7 +32,13 @@ public class QuizCommand implements CommandAPI { int eingabe = quizScanner.nextInt(); if (answerIsCorrect(eingabe, korrekteAntwort, antworten)) { - print("Richtige Antwort!\n"); + String playerpath = "src\\main\\resources\\playerconfig.json"; + JSONObject playerconfig = JsonParser.readJSONFile(playerpath); + int gold = playerconfig.getInt("gold"); + gold = gold + 5; + playerconfig.put("gold", gold); + JsonParser.writeObject(playerpath, playerconfig); + print("Richtig! Du hast 5 Münzen verdient.\nDein Münzstand beträgt: " + gold); } else { print("Leider falsch... Richtig ist: " + korrekteAntwort + "\n"); } From eadd9316e157fd30ef6027b7ab0112a753bebaa0 Mon Sep 17 00:00:00 2001 From: Friederike von Gruben Date: Thu, 2 Feb 2023 01:09:33 +0100 Subject: [PATCH 082/152] refactoring: Outsourced gold method The method to add gold after your answer was right is now in a seperate method --- .../org/bitbiome/commands/QuizCommand.java | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/main/java/org/bitbiome/commands/QuizCommand.java b/src/main/java/org/bitbiome/commands/QuizCommand.java index 2c1007d..658a898 100644 --- a/src/main/java/org/bitbiome/commands/QuizCommand.java +++ b/src/main/java/org/bitbiome/commands/QuizCommand.java @@ -32,13 +32,8 @@ public class QuizCommand implements CommandAPI { int eingabe = quizScanner.nextInt(); if (answerIsCorrect(eingabe, korrekteAntwort, antworten)) { - String playerpath = "src\\main\\resources\\playerconfig.json"; - JSONObject playerconfig = JsonParser.readJSONFile(playerpath); - int gold = playerconfig.getInt("gold"); - gold = gold + 5; - playerconfig.put("gold", gold); - JsonParser.writeObject(playerpath, playerconfig); - print("Richtig! Du hast 5 Münzen verdient.\nDein Münzstand beträgt: " + gold); + int neuerStand = addGold(); + print("Richtig! Du hast 5 Münzen verdient.\nDein Münzstand beträgt: " + neuerStand); } else { print("Leider falsch... Richtig ist: " + korrekteAntwort + "\n"); } @@ -68,6 +63,16 @@ public class QuizCommand implements CommandAPI { return sb.toString(); } + public static int addGold() { + String playerpath = "src\\main\\resources\\playerconfig.json"; + JSONObject playerconfig = JsonParser.readJSONFile(playerpath); + int gold = playerconfig.getInt("gold"); + gold = gold + 5; + playerconfig.put("gold", gold); + JsonParser.writeObject(playerpath, playerconfig); + return gold; + } + } From b4cc87b7ca622d978321c1e4a2b9ae03fdd8370f Mon Sep 17 00:00:00 2001 From: Friederike von Gruben Date: Thu, 2 Feb 2023 01:12:43 +0100 Subject: [PATCH 083/152] Added time feature for quiz You have to wait a min time after you can play the quiz again. Currently 5 minutes --- .../java/org/bitbiome/commands/QuizCommand.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/main/java/org/bitbiome/commands/QuizCommand.java b/src/main/java/org/bitbiome/commands/QuizCommand.java index 658a898..e261831 100644 --- a/src/main/java/org/bitbiome/commands/QuizCommand.java +++ b/src/main/java/org/bitbiome/commands/QuizCommand.java @@ -5,6 +5,7 @@ import org.bitbiome.classes.JsonParser; import org.json.JSONArray; import org.json.JSONObject; +import java.util.Date; import java.util.Random; import java.util.Scanner; @@ -17,6 +18,14 @@ public class QuizCommand implements CommandAPI { String path = "src\\main\\resources\\quiz.json"; JSONObject quiz = JsonParser.readJSONFile(path); + long currentTime = System.currentTimeMillis(); + long minTime = Long.parseLong(quiz.get("lastPlayed").toString()) + (60 * 5 * 1000); + if (minTime >= currentTime) { + long diff = minTime - currentTime; + System.out.println("Du darfst erst in " + diff / 1000 / 60 + " minuten spielen."); + return; + } + JSONArray fragen = quiz.getJSONArray("Quiz"); JSONObject frage = fragen.getJSONObject(random(fragen.length())); @@ -39,6 +48,11 @@ public class QuizCommand implements CommandAPI { } print("Das Quiz ist vorbei."); + + Date d = new Date(); + long lastPlayed = d.getTime(); + quiz.put("lastPlayed", lastPlayed); + JsonParser.writeObject(path, quiz); } public static boolean answerIsCorrect(int picked, String answer, JSONArray answers) { From d08bdb85e0d886dbd75685f9096539833407c757 Mon Sep 17 00:00:00 2001 From: Friederike von Gruben Date: Thu, 2 Feb 2023 01:19:28 +0100 Subject: [PATCH 084/152] refactoring: Outsourced time feature The time feature for the quiz has a seperate method now which returns the difference of the current time and the time you played the last time. If the difference is greater than 0 you can't play. --- .../java/org/bitbiome/commands/QuizCommand.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/bitbiome/commands/QuizCommand.java b/src/main/java/org/bitbiome/commands/QuizCommand.java index e261831..81e7b3d 100644 --- a/src/main/java/org/bitbiome/commands/QuizCommand.java +++ b/src/main/java/org/bitbiome/commands/QuizCommand.java @@ -18,11 +18,9 @@ public class QuizCommand implements CommandAPI { String path = "src\\main\\resources\\quiz.json"; JSONObject quiz = JsonParser.readJSONFile(path); - long currentTime = System.currentTimeMillis(); - long minTime = Long.parseLong(quiz.get("lastPlayed").toString()) + (60 * 5 * 1000); - if (minTime >= currentTime) { - long diff = minTime - currentTime; - System.out.println("Du darfst erst in " + diff / 1000 / 60 + " minuten spielen."); + long diffTime = canPlayAgain(quiz.getLong("lastPlayed")); + if (diffTime > 0) { + print("Du darfst erst in " + diffTime / 1000 / 60 + " minuten spielen."); return; } @@ -87,6 +85,12 @@ public class QuizCommand implements CommandAPI { return gold; } + public static long canPlayAgain(long lastPlayedTime) { + long currentTime = System.currentTimeMillis(); + long minTime = lastPlayedTime + (60 * 5 * 1000); + return minTime - currentTime; + } + } From 1749b5f66351b5f14f30888347bcf06380487a47 Mon Sep 17 00:00:00 2001 From: David Hermann Date: Mon, 6 Feb 2023 10:07:56 +0100 Subject: [PATCH 085/152] refactoring: Outsourced System.out.println --- .../java/org/bitbiome/classes/InteractionLoop.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/bitbiome/classes/InteractionLoop.java b/src/main/java/org/bitbiome/classes/InteractionLoop.java index a0b5017..bbf513d 100644 --- a/src/main/java/org/bitbiome/classes/InteractionLoop.java +++ b/src/main/java/org/bitbiome/classes/InteractionLoop.java @@ -12,7 +12,7 @@ public class InteractionLoop { public void run(TravelEngine travelEngine) { boolean isRunning = true; if (travelEngine.getPlayer().getName().equals("null")) { - System.out.println(Colors.ANSI_BLUE + "Oh, ein Fremder!\nBist du bereit für dein womöglich größtes Abenteuer?\nDann sag mir doch zunächst wie du heißt: " + Colors.ANSI_RESET); + print(Colors.ANSI_BLUE + "Oh, ein Fremder!\nBist du bereit für dein womöglich größtes Abenteuer?\nDann sag mir doch zunächst wie du heißt: " + Colors.ANSI_RESET); String name = input.nextLine(); JsonParser jp = new JsonParser(); JSONObject playerconf = jp.getJSONObject("playerconfig.json"); @@ -20,15 +20,20 @@ public class InteractionLoop { travelEngine.getPlayer().setName(name); jp.writeObject("playerconfig.json", playerconf); } - System.out.println(Colors.ANSI_BG_CYAN + Colors.ANSI_BLACK + "Willkommen zu BitBiome " + travelEngine.getPlayer().getName() + "!" + Colors.ANSI_RESET + "\n\n"); + print(Colors.ANSI_BG_CYAN + Colors.ANSI_BLACK + "Willkommen zu BitBiome " + travelEngine.getPlayer().getName() + "!" + Colors.ANSI_RESET + "\n\n"); while (isRunning) { String line = input.nextLine().toLowerCase(); if (!Boot.instance.getCmdListener().perform(line.toLowerCase().split(" ")[0], input, isRunning, line, travelEngine)) { - System.out.println(Colors.ANSI_RED + "Unbekannter Befehl - Siehe " + Colors.ANSI_PURPLE + "help\n" + Colors.ANSI_RESET); + print(Colors.ANSI_RED + "Unbekannter Befehl - Siehe " + Colors.ANSI_PURPLE + "help\n" + Colors.ANSI_RESET); } } } + public boolean print(String message) { + System.out.println(message); + return true; + } + } From 4e990e2d04321291f620cfeb23b416874abb1419 Mon Sep 17 00:00:00 2001 From: David Hermann Date: Mon, 6 Feb 2023 10:17:22 +0100 Subject: [PATCH 086/152] refactoring: Outsourced code in InteractionLoop Whether the player is new or not will be checked in new outsourced function --- src/main/java/org/bitbiome/classes/InteractionLoop.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/bitbiome/classes/InteractionLoop.java b/src/main/java/org/bitbiome/classes/InteractionLoop.java index bbf513d..5cd9a59 100644 --- a/src/main/java/org/bitbiome/classes/InteractionLoop.java +++ b/src/main/java/org/bitbiome/classes/InteractionLoop.java @@ -11,7 +11,7 @@ public class InteractionLoop { public void run(TravelEngine travelEngine) { boolean isRunning = true; - if (travelEngine.getPlayer().getName().equals("null")) { + if (playerIsNew(travelEngine.getPlayer().getName())) { print(Colors.ANSI_BLUE + "Oh, ein Fremder!\nBist du bereit für dein womöglich größtes Abenteuer?\nDann sag mir doch zunächst wie du heißt: " + Colors.ANSI_RESET); String name = input.nextLine(); JsonParser jp = new JsonParser(); @@ -34,6 +34,10 @@ public class InteractionLoop { return true; } + public boolean playerIsNew(String name) { + return name.equalsIgnoreCase("null"); + } + } From d6ece832e7768909c1e77e1dc34fc800fcd3f5bb Mon Sep 17 00:00:00 2001 From: David Hermann Date: Mon, 6 Feb 2023 10:39:23 +0100 Subject: [PATCH 087/152] refactoring: Outsourced code When the player is new a outsourced method is called --- .../org/bitbiome/classes/InteractionLoop.java | 30 +++++++++++-------- 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/src/main/java/org/bitbiome/classes/InteractionLoop.java b/src/main/java/org/bitbiome/classes/InteractionLoop.java index 5cd9a59..f8a6c84 100644 --- a/src/main/java/org/bitbiome/classes/InteractionLoop.java +++ b/src/main/java/org/bitbiome/classes/InteractionLoop.java @@ -4,7 +4,6 @@ import org.bitbiome.Boot; import org.json.JSONObject; import java.util.Scanner; - public class InteractionLoop { Scanner input = new Scanner(System.in); @@ -12,19 +11,16 @@ public class InteractionLoop { public void run(TravelEngine travelEngine) { boolean isRunning = true; if (playerIsNew(travelEngine.getPlayer().getName())) { - print(Colors.ANSI_BLUE + "Oh, ein Fremder!\nBist du bereit für dein womöglich größtes Abenteuer?\nDann sag mir doch zunächst wie du heißt: " + Colors.ANSI_RESET); - String name = input.nextLine(); - JsonParser jp = new JsonParser(); - JSONObject playerconf = jp.getJSONObject("playerconfig.json"); - playerconf.put("name", name); - travelEngine.getPlayer().setName(name); - jp.writeObject("playerconfig.json", playerconf); + newPlayerWelcome(travelEngine); } - print(Colors.ANSI_BG_CYAN + Colors.ANSI_BLACK + "Willkommen zu BitBiome " + travelEngine.getPlayer().getName() + "!" + Colors.ANSI_RESET + "\n\n"); + print(Colors.ANSI_BG_CYAN + Colors.ANSI_BLACK + "Willkommen zu BitBiome " + travelEngine.getPlayer().getName() + + "!" + Colors.ANSI_RESET + "\n\n"); while (isRunning) { String line = input.nextLine().toLowerCase(); - if (!Boot.instance.getCmdListener().perform(line.toLowerCase().split(" ")[0], input, isRunning, line, travelEngine)) { - print(Colors.ANSI_RED + "Unbekannter Befehl - Siehe " + Colors.ANSI_PURPLE + "help\n" + Colors.ANSI_RESET); + if (!Boot.instance.getCmdListener().perform(line.toLowerCase().split(" ")[0], input, isRunning, line, + travelEngine)) { + print(Colors.ANSI_RED + "Unbekannter Befehl - Siehe " + Colors.ANSI_PURPLE + "help\n" + + Colors.ANSI_RESET); } } } @@ -38,6 +34,16 @@ public class InteractionLoop { return name.equalsIgnoreCase("null"); } - + public void newPlayerWelcome(TravelEngine travelEngine) { + print(Colors.ANSI_BLUE + + "Oh, ein Fremder!\nBist du bereit für dein womöglich größtes Abenteuer?\nDann sag mir doch zunächst wie du heißt: " + + Colors.ANSI_RESET); + String name = input.nextLine(); + JsonParser jp = new JsonParser(); + JSONObject playerconf = jp.getJSONObject("playerconfig.json"); + playerconf.put("name", name); + travelEngine.getPlayer().setName(name); + jp.writeObject("playerconfig.json", playerconf); + } } From fda96a5acb65c3b651dee5235a7f70e049f82bd5 Mon Sep 17 00:00:00 2001 From: David Hermann Date: Mon, 6 Feb 2023 10:41:41 +0100 Subject: [PATCH 088/152] refactoring: Deleted CreateLocations --- .../org/bitbiome/classes/CreateLocations.java | 24 ------------------- 1 file changed, 24 deletions(-) delete mode 100644 src/main/java/org/bitbiome/classes/CreateLocations.java diff --git a/src/main/java/org/bitbiome/classes/CreateLocations.java b/src/main/java/org/bitbiome/classes/CreateLocations.java deleted file mode 100644 index ed237a1..0000000 --- a/src/main/java/org/bitbiome/classes/CreateLocations.java +++ /dev/null @@ -1,24 +0,0 @@ -package org.bitbiome.classes; - -import org.bitbiome.entities.Item; -import org.bitbiome.entities.Location; -import org.bitbiome.entities.Mob; - -import java.util.ArrayList; - -public class CreateLocations { - - public static Location createForest() { - ArrayList items = new ArrayList<>(); - ArrayList mobs = new ArrayList<>(); - String name = "Wald"; - return new Location(name, mobs, items); - } - - public static Location createBeach() { - ArrayList items = new ArrayList<>(); - ArrayList mobs = new ArrayList<>(); - String name = "Strand"; - return new Location(name, mobs, items); - } -} From 9ebe7ea258f84b34dd3cfdc207d07759796a770b Mon Sep 17 00:00:00 2001 From: David Hermann Date: Mon, 6 Feb 2023 10:48:37 +0100 Subject: [PATCH 089/152] refactoring: Outsourced System.out.println --- .../java/org/bitbiome/commands/TravelCommand.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/bitbiome/commands/TravelCommand.java b/src/main/java/org/bitbiome/commands/TravelCommand.java index da5cbe7..810333e 100644 --- a/src/main/java/org/bitbiome/commands/TravelCommand.java +++ b/src/main/java/org/bitbiome/commands/TravelCommand.java @@ -16,18 +16,23 @@ public class TravelCommand implements CommandAPI { @Override public void performCommand(Scanner scanner, boolean isRunning, String message, TravelEngine travelEngine) { - System.out.println(Colors.ANSI_BLUE + "Du hast dein Travel-Pad gezückt. Wohin möchtest du reisen?" + Colors.ANSI_RESET); + print(Colors.ANSI_BLUE + "Du hast dein Travel-Pad gezückt. Wohin möchtest du reisen?" + Colors.ANSI_RESET); JSONArray locations = travelEngine.getLocationList(); for (int i = 0; i < locations.length(); i++) { - System.out.println("- " + locations.getJSONObject(i).getString("name")); + print("- " + locations.getJSONObject(i).getString("name")); } String locationName = scanner.nextLine(); if (travelEngine.locationExists(locationName)) { travelEngine.travelTo(new Location(locationName, new ArrayList(), new ArrayList())); - System.out.println(Colors.ANSI_BLUE + "Du bist nun hierhin gereist: " + locationName + "\n" + Colors.ANSI_RESET); + print(Colors.ANSI_BLUE + "Du bist nun hierhin gereist: " + locationName + "\n" + Colors.ANSI_RESET); } else { - System.out.println(Colors.ANSI_BLUE + "Du hast dein Travel-Pad weggesteckt." + Colors.ANSI_RESET); + print(Colors.ANSI_BLUE + "Du hast dein Travel-Pad weggesteckt." + Colors.ANSI_RESET); } } + + public String print(String message) { + System.out.println(message); + return message; + } } From 460fc7157038129ad248030f981f9e5d677d43f7 Mon Sep 17 00:00:00 2001 From: David Hermann Date: Mon, 6 Feb 2023 11:17:56 +0100 Subject: [PATCH 090/152] refactoring: Added comment to Color --- .../java/org/bitbiome/classes/Colors.java | 106 +++++++++--------- 1 file changed, 56 insertions(+), 50 deletions(-) diff --git a/src/main/java/org/bitbiome/classes/Colors.java b/src/main/java/org/bitbiome/classes/Colors.java index d08f59e..99e45e1 100644 --- a/src/main/java/org/bitbiome/classes/Colors.java +++ b/src/main/java/org/bitbiome/classes/Colors.java @@ -2,55 +2,61 @@ package org.bitbiome.classes; public class Colors { - public static final String ANSI_RESET = "\u001B[0m"; - - public static final String ANSI_BLACK = "\u001B[30m"; - public static final String ANSI_RED = "\u001B[31m"; - public static final String ANSI_GREEN = "\u001B[32m"; - public static final String ANSI_YELLOW = "\u001B[33m"; - public static final String ANSI_BLUE = "\u001B[34m"; - public static final String ANSI_PURPLE = "\u001B[35m"; - public static final String ANSI_CYAN = "\u001B[36m"; - public static final String ANSI_WHITE = "\u001B[37m"; - - public static final String ANSI_BRIGHT_BLACK = "\u001B[90m"; - public static final String ANSI_BRIGHT_RED = "\u001B[91m"; - public static final String ANSI_BRIGHT_GREEN = "\u001B[92m"; - public static final String ANSI_BRIGHT_YELLOW = "\u001B[93m"; - public static final String ANSI_BRIGHT_BLUE = "\u001B[94m"; - public static final String ANSI_BRIGHT_PURPLE = "\u001B[95m"; - public static final String ANSI_BRIGHT_CYAN = "\u001B[96m"; - public static final String ANSI_BRIGHT_WHITE = "\u001B[97m"; - - public static final String[] FOREGROUNDS = { - ANSI_BLACK, ANSI_RED, ANSI_GREEN, ANSI_YELLOW, - ANSI_BLUE, ANSI_PURPLE, ANSI_CYAN, ANSI_WHITE, - ANSI_BRIGHT_BLACK, ANSI_BRIGHT_RED, ANSI_BRIGHT_GREEN, ANSI_BRIGHT_YELLOW, - ANSI_BRIGHT_BLUE, ANSI_BRIGHT_PURPLE, ANSI_BRIGHT_CYAN, ANSI_BRIGHT_WHITE - }; - - public static final String ANSI_BG_BLACK = "\u001B[40m"; - public static final String ANSI_BG_RED = "\u001B[41m"; - public static final String ANSI_BG_GREEN = "\u001B[42m"; - public static final String ANSI_BG_YELLOW = "\u001B[43m"; - public static final String ANSI_BG_BLUE = "\u001B[44m"; - public static final String ANSI_BG_PURPLE = "\u001B[45m"; - public static final String ANSI_BG_CYAN = "\u001B[46m"; - public static final String ANSI_BG_WHITE = "\u001B[47m"; - - public static final String ANSI_BRIGHT_BG_BLACK = "\u001B[100m"; - public static final String ANSI_BRIGHT_BG_RED = "\u001B[101m"; - public static final String ANSI_BRIGHT_BG_GREEN = "\u001B[102m"; - public static final String ANSI_BRIGHT_BG_YELLOW = "\u001B[103m"; - public static final String ANSI_BRIGHT_BG_BLUE = "\u001B[104m"; - public static final String ANSI_BRIGHT_BG_PURPLE = "\u001B[105m"; - public static final String ANSI_BRIGHT_BG_CYAN = "\u001B[106m"; - public static final String ANSI_BRIGHT_BG_WHITE = "\u001B[107m"; - - public static final String[] BACKGROUNDS = { - ANSI_BG_BLACK, ANSI_BG_RED, ANSI_BG_GREEN, ANSI_BG_YELLOW, - ANSI_BG_BLUE, ANSI_BG_PURPLE, ANSI_BG_CYAN, ANSI_BG_WHITE, - ANSI_BRIGHT_BG_BLACK, ANSI_BRIGHT_BG_RED, ANSI_BRIGHT_BG_GREEN, ANSI_BRIGHT_BG_YELLOW, - ANSI_BRIGHT_BG_BLUE, ANSI_BRIGHT_BG_PURPLE, ANSI_BRIGHT_BG_CYAN, ANSI_BRIGHT_BG_WHITE }; + /* + * This class has only public static mehtods + * Just add a String to your String and finalize it with the ANSI_RESET String + * The Color Codes with BG in the variable name are for the background colors + */ + + public static final String ANSI_RESET = "\u001B[0m"; + + public static final String ANSI_BLACK = "\u001B[30m"; + public static final String ANSI_RED = "\u001B[31m"; + public static final String ANSI_GREEN = "\u001B[32m"; + public static final String ANSI_YELLOW = "\u001B[33m"; + public static final String ANSI_BLUE = "\u001B[34m"; + public static final String ANSI_PURPLE = "\u001B[35m"; + public static final String ANSI_CYAN = "\u001B[36m"; + public static final String ANSI_WHITE = "\u001B[37m"; + + public static final String ANSI_BRIGHT_BLACK = "\u001B[90m"; + public static final String ANSI_BRIGHT_RED = "\u001B[91m"; + public static final String ANSI_BRIGHT_GREEN = "\u001B[92m"; + public static final String ANSI_BRIGHT_YELLOW = "\u001B[93m"; + public static final String ANSI_BRIGHT_BLUE = "\u001B[94m"; + public static final String ANSI_BRIGHT_PURPLE = "\u001B[95m"; + public static final String ANSI_BRIGHT_CYAN = "\u001B[96m"; + public static final String ANSI_BRIGHT_WHITE = "\u001B[97m"; + + public static final String[] FOREGROUNDS = { + ANSI_BLACK, ANSI_RED, ANSI_GREEN, ANSI_YELLOW, + ANSI_BLUE, ANSI_PURPLE, ANSI_CYAN, ANSI_WHITE, + ANSI_BRIGHT_BLACK, ANSI_BRIGHT_RED, ANSI_BRIGHT_GREEN, ANSI_BRIGHT_YELLOW, + ANSI_BRIGHT_BLUE, ANSI_BRIGHT_PURPLE, ANSI_BRIGHT_CYAN, ANSI_BRIGHT_WHITE + }; + + public static final String ANSI_BG_BLACK = "\u001B[40m"; + public static final String ANSI_BG_RED = "\u001B[41m"; + public static final String ANSI_BG_GREEN = "\u001B[42m"; + public static final String ANSI_BG_YELLOW = "\u001B[43m"; + public static final String ANSI_BG_BLUE = "\u001B[44m"; + public static final String ANSI_BG_PURPLE = "\u001B[45m"; + public static final String ANSI_BG_CYAN = "\u001B[46m"; + public static final String ANSI_BG_WHITE = "\u001B[47m"; + + public static final String ANSI_BRIGHT_BG_BLACK = "\u001B[100m"; + public static final String ANSI_BRIGHT_BG_RED = "\u001B[101m"; + public static final String ANSI_BRIGHT_BG_GREEN = "\u001B[102m"; + public static final String ANSI_BRIGHT_BG_YELLOW = "\u001B[103m"; + public static final String ANSI_BRIGHT_BG_BLUE = "\u001B[104m"; + public static final String ANSI_BRIGHT_BG_PURPLE = "\u001B[105m"; + public static final String ANSI_BRIGHT_BG_CYAN = "\u001B[106m"; + public static final String ANSI_BRIGHT_BG_WHITE = "\u001B[107m"; + + public static final String[] BACKGROUNDS = { + ANSI_BG_BLACK, ANSI_BG_RED, ANSI_BG_GREEN, ANSI_BG_YELLOW, + ANSI_BG_BLUE, ANSI_BG_PURPLE, ANSI_BG_CYAN, ANSI_BG_WHITE, + ANSI_BRIGHT_BG_BLACK, ANSI_BRIGHT_BG_RED, ANSI_BRIGHT_BG_GREEN, ANSI_BRIGHT_BG_YELLOW, + ANSI_BRIGHT_BG_BLUE, ANSI_BRIGHT_BG_PURPLE, ANSI_BRIGHT_BG_CYAN, ANSI_BRIGHT_BG_WHITE }; } From ad5f87a4b0332170961a112eb3493006573e1a1c Mon Sep 17 00:00:00 2001 From: David Hermann Date: Mon, 6 Feb 2023 11:21:36 +0100 Subject: [PATCH 091/152] refactoring: Added comments to CommandInterface --- src/main/java/org/bitbiome/commands/CommandAPI.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/org/bitbiome/commands/CommandAPI.java b/src/main/java/org/bitbiome/commands/CommandAPI.java index a5c48be..9e5ade8 100644 --- a/src/main/java/org/bitbiome/commands/CommandAPI.java +++ b/src/main/java/org/bitbiome/commands/CommandAPI.java @@ -5,6 +5,10 @@ import org.bitbiome.classes.TravelEngine; import java.util.Scanner; public interface CommandAPI { + + // This is the command interface. Every command implements it's run method from here + // This is the API between the commands and the interaction loop/game + public void performCommand(Scanner scanner, boolean isRunning, String message, TravelEngine travelEngine); } From b26a43dfcbb824f587895f2ea341542ae8e3eaa7 Mon Sep 17 00:00:00 2001 From: David Hermann Date: Mon, 6 Feb 2023 11:24:45 +0100 Subject: [PATCH 092/152] refactoring: Added comments to CommandListener --- src/main/java/org/bitbiome/commands/CommandListener.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/bitbiome/commands/CommandListener.java b/src/main/java/org/bitbiome/commands/CommandListener.java index d59813c..d30ef1f 100644 --- a/src/main/java/org/bitbiome/commands/CommandListener.java +++ b/src/main/java/org/bitbiome/commands/CommandListener.java @@ -6,7 +6,9 @@ import java.util.HashMap; import java.util.Scanner; public class CommandListener { - + // This class is the API between the command interface and the user input + // This class is used to handle all the commands + // The commands are stored in a hashmap private HashMap commands; public CommandListener() { From 3e4259170cebe5dfb1fa2d16073a96d7e7f67c51 Mon Sep 17 00:00:00 2001 From: David Hermann Date: Mon, 6 Feb 2023 11:28:09 +0100 Subject: [PATCH 093/152] refactoring: Added comments to QuitCommand --- src/main/java/org/bitbiome/commands/QuitCommand.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/org/bitbiome/commands/QuitCommand.java b/src/main/java/org/bitbiome/commands/QuitCommand.java index 25dbb00..258ab1a 100644 --- a/src/main/java/org/bitbiome/commands/QuitCommand.java +++ b/src/main/java/org/bitbiome/commands/QuitCommand.java @@ -6,6 +6,10 @@ import java.util.Scanner; public class QuitCommand implements CommandAPI { + // This command is used to end the game via command + // When the player quits the game, the game is stopped through System.exit(0) + // That means it is exited with no error status + @Override public void performCommand(Scanner scanner, boolean isRunning, String message, TravelEngine travelEngine) { System.out.println(getQuitMessage()); From 23c162d5246115b5603b771065252f9870cfcaf5 Mon Sep 17 00:00:00 2001 From: David Hermann Date: Mon, 6 Feb 2023 11:36:56 +0100 Subject: [PATCH 094/152] unittest: Created test for important color codes --- src/test/java/org/bitbiome/classes/ColorsTest.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 src/test/java/org/bitbiome/classes/ColorsTest.java diff --git a/src/test/java/org/bitbiome/classes/ColorsTest.java b/src/test/java/org/bitbiome/classes/ColorsTest.java new file mode 100644 index 0000000..21069bb --- /dev/null +++ b/src/test/java/org/bitbiome/classes/ColorsTest.java @@ -0,0 +1,13 @@ +package org.bitbiome.classes; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import org.junit.jupiter.api.Test; + +public class ColorsTest { + + @Test + public void testResetCode() { + assertEquals("\u001B[0m", Colors.ANSI_RESET); + } +} From 76aeb8fc0fc9529176aa45444fa5d85400ec38bd Mon Sep 17 00:00:00 2001 From: David Hermann Date: Mon, 6 Feb 2023 11:38:13 +0100 Subject: [PATCH 095/152] unittest: Created test for blue color --- src/test/java/org/bitbiome/classes/ColorsTest.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/test/java/org/bitbiome/classes/ColorsTest.java b/src/test/java/org/bitbiome/classes/ColorsTest.java index 21069bb..d6cc36b 100644 --- a/src/test/java/org/bitbiome/classes/ColorsTest.java +++ b/src/test/java/org/bitbiome/classes/ColorsTest.java @@ -10,4 +10,9 @@ public class ColorsTest { public void testResetCode() { assertEquals("\u001B[0m", Colors.ANSI_RESET); } + + @Test + public void testBlueCode() { + assertEquals("\u001B[34m", Colors.ANSI_BLUE); + } } From 7ec03825398edf2eedf9947932b8578b380422b4 Mon Sep 17 00:00:00 2001 From: David Hermann Date: Mon, 6 Feb 2023 11:42:03 +0100 Subject: [PATCH 096/152] unittest: Created test for cyan code --- src/test/java/org/bitbiome/classes/ColorsTest.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/test/java/org/bitbiome/classes/ColorsTest.java b/src/test/java/org/bitbiome/classes/ColorsTest.java index d6cc36b..541ebdf 100644 --- a/src/test/java/org/bitbiome/classes/ColorsTest.java +++ b/src/test/java/org/bitbiome/classes/ColorsTest.java @@ -15,4 +15,9 @@ public class ColorsTest { public void testBlueCode() { assertEquals("\u001B[34m", Colors.ANSI_BLUE); } + + @Test + public void testCyanCode() { + assertEquals("\u001B[36m", Colors.ANSI_CYAN); + } } From b4ff7a5d2a8732cd62879e35268b4a84f6fa92f4 Mon Sep 17 00:00:00 2001 From: Friederike von Gruben Date: Mon, 6 Feb 2023 13:18:51 +0100 Subject: [PATCH 097/152] refactoring: Outsourced code Outsourced starter quiz message --- src/main/java/org/bitbiome/commands/QuizCommand.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/bitbiome/commands/QuizCommand.java b/src/main/java/org/bitbiome/commands/QuizCommand.java index 81e7b3d..d1ab06d 100644 --- a/src/main/java/org/bitbiome/commands/QuizCommand.java +++ b/src/main/java/org/bitbiome/commands/QuizCommand.java @@ -32,7 +32,7 @@ public class QuizCommand implements CommandAPI { String korrekteAntwort = frage.getString("korrekteAntwort"); - print("Du hast das Quiz gestartet! Hinweis: Wähle deine Antwort, indem du die Zahl (1-4) eingibst. Ist deine Lösung richtig, erhälst du 5 Münzen. Viel Erfolg! \n"); + print(anfangsnachricht()); print(generateQuestion(frage, antworten)); @@ -91,6 +91,10 @@ public class QuizCommand implements CommandAPI { return minTime - currentTime; } + public static String anfangsnachricht(){ + return "Du hast das Quiz gestartet! Hinweis: Wähle deine Antwort, indem du die Zahl (1-4) eingibst. Ist deine Lösung richtig, erhälst du 5 Münzen. Viel Erfolg! \n"; + + } } From 7ccb7ee30400f2fc6ddf40ce6114bb69a7f46709 Mon Sep 17 00:00:00 2001 From: Friederike von Gruben Date: Mon, 6 Feb 2023 13:19:19 +0100 Subject: [PATCH 098/152] refactoring: Outsourced code Outsourced ending quiz message --- src/main/java/org/bitbiome/commands/QuizCommand.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/bitbiome/commands/QuizCommand.java b/src/main/java/org/bitbiome/commands/QuizCommand.java index d1ab06d..526a0da 100644 --- a/src/main/java/org/bitbiome/commands/QuizCommand.java +++ b/src/main/java/org/bitbiome/commands/QuizCommand.java @@ -45,7 +45,7 @@ public class QuizCommand implements CommandAPI { print("Leider falsch... Richtig ist: " + korrekteAntwort + "\n"); } - print("Das Quiz ist vorbei."); + print(endmessage()); Date d = new Date(); long lastPlayed = d.getTime(); @@ -95,6 +95,10 @@ public class QuizCommand implements CommandAPI { return "Du hast das Quiz gestartet! Hinweis: Wähle deine Antwort, indem du die Zahl (1-4) eingibst. Ist deine Lösung richtig, erhälst du 5 Münzen. Viel Erfolg! \n"; } + + public static String endmessage(){ + return "Das Quiz ist vorbei!"; + } } From f92d8f58470252a8a55818e5d2dac89045a921c2 Mon Sep 17 00:00:00 2001 From: Friederike von Gruben Date: Mon, 6 Feb 2023 13:20:33 +0100 Subject: [PATCH 099/152] Updated quiz message How long user has to wait to play toward --- src/main/java/org/bitbiome/commands/QuizCommand.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/bitbiome/commands/QuizCommand.java b/src/main/java/org/bitbiome/commands/QuizCommand.java index 526a0da..307ec3d 100644 --- a/src/main/java/org/bitbiome/commands/QuizCommand.java +++ b/src/main/java/org/bitbiome/commands/QuizCommand.java @@ -20,7 +20,7 @@ public class QuizCommand implements CommandAPI { long diffTime = canPlayAgain(quiz.getLong("lastPlayed")); if (diffTime > 0) { - print("Du darfst erst in " + diffTime / 1000 / 60 + " minuten spielen."); + print("Du darfst erst in " + diffTime / 1000 / 60 + " Minuten spielen."); return; } From 05693206bd677d5923417b1e2c13d6895a40ddbf Mon Sep 17 00:00:00 2001 From: Friederike von Gruben Date: Mon, 6 Feb 2023 13:26:19 +0100 Subject: [PATCH 100/152] refactoring: Edited method name in QuizCommand anfangsnachricht -> starterMessage --- src/main/java/org/bitbiome/commands/QuizCommand.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/bitbiome/commands/QuizCommand.java b/src/main/java/org/bitbiome/commands/QuizCommand.java index 307ec3d..a4210ac 100644 --- a/src/main/java/org/bitbiome/commands/QuizCommand.java +++ b/src/main/java/org/bitbiome/commands/QuizCommand.java @@ -32,7 +32,7 @@ public class QuizCommand implements CommandAPI { String korrekteAntwort = frage.getString("korrekteAntwort"); - print(anfangsnachricht()); + print(starterMessage()); print(generateQuestion(frage, antworten)); @@ -91,7 +91,7 @@ public class QuizCommand implements CommandAPI { return minTime - currentTime; } - public static String anfangsnachricht(){ + public static String starterMessage(){ return "Du hast das Quiz gestartet! Hinweis: Wähle deine Antwort, indem du die Zahl (1-4) eingibst. Ist deine Lösung richtig, erhälst du 5 Münzen. Viel Erfolg! \n"; } From 915d3829dc0bf219187c42fe6588616a862f871e Mon Sep 17 00:00:00 2001 From: Friederike von Gruben Date: Mon, 6 Feb 2023 13:26:43 +0100 Subject: [PATCH 101/152] refactoring: Edited method name in QuizCommand endmessage -> endMessage *Camel Case Convention --- src/main/java/org/bitbiome/commands/QuizCommand.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/bitbiome/commands/QuizCommand.java b/src/main/java/org/bitbiome/commands/QuizCommand.java index a4210ac..db0316e 100644 --- a/src/main/java/org/bitbiome/commands/QuizCommand.java +++ b/src/main/java/org/bitbiome/commands/QuizCommand.java @@ -45,7 +45,7 @@ public class QuizCommand implements CommandAPI { print("Leider falsch... Richtig ist: " + korrekteAntwort + "\n"); } - print(endmessage()); + print(endMessage()); Date d = new Date(); long lastPlayed = d.getTime(); @@ -96,7 +96,7 @@ public class QuizCommand implements CommandAPI { } - public static String endmessage(){ + public static String endMessage(){ return "Das Quiz ist vorbei!"; } } From ada95c7e03706602cc70455e3300633b29dfa7bf Mon Sep 17 00:00:00 2001 From: Friederike von Gruben Date: Mon, 6 Feb 2023 13:34:20 +0100 Subject: [PATCH 102/152] unittest: Created test for QuizCommand This test tests the start/welcome message to the quiz --- .../java/org/bitbiome/commands/QuizCommandTest.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 src/test/java/org/bitbiome/commands/QuizCommandTest.java diff --git a/src/test/java/org/bitbiome/commands/QuizCommandTest.java b/src/test/java/org/bitbiome/commands/QuizCommandTest.java new file mode 100644 index 0000000..14b73a7 --- /dev/null +++ b/src/test/java/org/bitbiome/commands/QuizCommandTest.java @@ -0,0 +1,13 @@ +package org.bitbiome.commands; + +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +public class QuizCommandTest { + + @Test + public void testStartMessage() { + assertEquals("Du hast das Quiz gestartet! Hinweis: Wähle deine Antwort, indem du die Zahl (1-4) eingibst. Ist deine Lösung richtig, erhälst du 5 Münzen. Viel Erfolg! \n", QuizCommand.starterMessage()); + } +} From c8c68946b0d77614fea7e4e48cb2ded620e551a3 Mon Sep 17 00:00:00 2001 From: Friederike von Gruben Date: Mon, 6 Feb 2023 13:35:52 +0100 Subject: [PATCH 103/152] unittest: Edited test for QuizCommand This test tests the ending message for the quiz --- src/test/java/org/bitbiome/commands/QuizCommandTest.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/test/java/org/bitbiome/commands/QuizCommandTest.java b/src/test/java/org/bitbiome/commands/QuizCommandTest.java index 14b73a7..1668be2 100644 --- a/src/test/java/org/bitbiome/commands/QuizCommandTest.java +++ b/src/test/java/org/bitbiome/commands/QuizCommandTest.java @@ -10,4 +10,9 @@ public class QuizCommandTest { public void testStartMessage() { assertEquals("Du hast das Quiz gestartet! Hinweis: Wähle deine Antwort, indem du die Zahl (1-4) eingibst. Ist deine Lösung richtig, erhälst du 5 Münzen. Viel Erfolg! \n", QuizCommand.starterMessage()); } + + @Test + public void testEndMessage() { + assertEquals("Das Quiz ist vorbei!", QuizCommand.endMessage()); + } } From e6b712ca09847b466cf91eafa2fad129ec63de54 Mon Sep 17 00:00:00 2001 From: Friederike von Gruben Date: Mon, 6 Feb 2023 13:39:14 +0100 Subject: [PATCH 104/152] unittest: Edited test for QuizCommand This test tests whether the canPlayAgain function works or not --- src/test/java/org/bitbiome/commands/QuizCommandTest.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/test/java/org/bitbiome/commands/QuizCommandTest.java b/src/test/java/org/bitbiome/commands/QuizCommandTest.java index 1668be2..93afc23 100644 --- a/src/test/java/org/bitbiome/commands/QuizCommandTest.java +++ b/src/test/java/org/bitbiome/commands/QuizCommandTest.java @@ -2,7 +2,7 @@ package org.bitbiome.commands; import org.junit.jupiter.api.Test; -import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.*; public class QuizCommandTest { @@ -15,4 +15,10 @@ public class QuizCommandTest { public void testEndMessage() { assertEquals("Das Quiz ist vorbei!", QuizCommand.endMessage()); } + + @Test + public void testLastTimePlayed() { + long lastTimePlayed = System.currentTimeMillis(); + assertTrue(QuizCommand.canPlayAgain(lastTimePlayed) < lastTimePlayed); + } } From 56794efd3be7db992e2059d5ee61e373ddf2ed29 Mon Sep 17 00:00:00 2001 From: Friederike von Gruben Date: Mon, 6 Feb 2023 13:46:42 +0100 Subject: [PATCH 105/152] unittest: Edited test for QuizCommand This test tests the random function which gives a random number between 0 and a length back --- src/test/java/org/bitbiome/commands/QuizCommandTest.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/test/java/org/bitbiome/commands/QuizCommandTest.java b/src/test/java/org/bitbiome/commands/QuizCommandTest.java index 93afc23..520ae87 100644 --- a/src/test/java/org/bitbiome/commands/QuizCommandTest.java +++ b/src/test/java/org/bitbiome/commands/QuizCommandTest.java @@ -2,6 +2,8 @@ package org.bitbiome.commands; import org.junit.jupiter.api.Test; +import java.util.Random; + import static org.junit.jupiter.api.Assertions.*; public class QuizCommandTest { @@ -21,4 +23,10 @@ public class QuizCommandTest { long lastTimePlayed = System.currentTimeMillis(); assertTrue(QuizCommand.canPlayAgain(lastTimePlayed) < lastTimePlayed); } + + @Test + public void testRandomNumberGenerator() { + int getRandom = QuizCommand.random(3); + assertTrue(getRandom >= 0 && getRandom <= 3); + } } From 3641292f5e552a0c510c424999dcbb0ce4233f06 Mon Sep 17 00:00:00 2001 From: Friederike von Gruben Date: Mon, 6 Feb 2023 13:47:13 +0100 Subject: [PATCH 106/152] refactoring: Deleted unused imports --- src/test/java/org/bitbiome/commands/QuizCommandTest.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/test/java/org/bitbiome/commands/QuizCommandTest.java b/src/test/java/org/bitbiome/commands/QuizCommandTest.java index 520ae87..cb16ee6 100644 --- a/src/test/java/org/bitbiome/commands/QuizCommandTest.java +++ b/src/test/java/org/bitbiome/commands/QuizCommandTest.java @@ -2,7 +2,6 @@ package org.bitbiome.commands; import org.junit.jupiter.api.Test; -import java.util.Random; import static org.junit.jupiter.api.Assertions.*; From 46422e4d5cb8fdda1987285d3277f355967ebc4f Mon Sep 17 00:00:00 2001 From: Friederike von Gruben Date: Mon, 6 Feb 2023 13:52:01 +0100 Subject: [PATCH 107/152] unittest: Edited test for QuizCommand This test tests the print function --- src/test/java/org/bitbiome/commands/QuizCommandTest.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/test/java/org/bitbiome/commands/QuizCommandTest.java b/src/test/java/org/bitbiome/commands/QuizCommandTest.java index cb16ee6..937b97d 100644 --- a/src/test/java/org/bitbiome/commands/QuizCommandTest.java +++ b/src/test/java/org/bitbiome/commands/QuizCommandTest.java @@ -28,4 +28,9 @@ public class QuizCommandTest { int getRandom = QuizCommand.random(3); assertTrue(getRandom >= 0 && getRandom <= 3); } + + @Test + public void testPrintFunction() { + assertEquals("I am a unit test!", QuizCommand.print("I am a unit test!")); + } } From bf45a594055377a5987cc495ffe0824259a4303f Mon Sep 17 00:00:00 2001 From: Friederike von Gruben Date: Mon, 6 Feb 2023 13:54:47 +0100 Subject: [PATCH 108/152] 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() { From 66d9d812c79f5fb45b944bce2f4c517723b1070a Mon Sep 17 00:00:00 2001 From: Friederike von Gruben Date: Mon, 6 Feb 2023 13:57:27 +0100 Subject: [PATCH 109/152] refactoring: The HashMap commands is final now --- src/main/java/org/bitbiome/commands/CommandListener.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/bitbiome/commands/CommandListener.java b/src/main/java/org/bitbiome/commands/CommandListener.java index ebc7dbc..5a9bcfe 100644 --- a/src/main/java/org/bitbiome/commands/CommandListener.java +++ b/src/main/java/org/bitbiome/commands/CommandListener.java @@ -5,7 +5,7 @@ import java.util.Scanner; public class CommandListener { - private HashMap commands; + private final HashMap commands; public CommandListener() { commands = new HashMap<>(); From d0142a9c269b5be83e5c55606409e0cab389284e Mon Sep 17 00:00:00 2001 From: Friederike von Gruben Date: Mon, 6 Feb 2023 13:58:33 +0100 Subject: [PATCH 110/152] refactoring: Deleted unused method returnCommands() --- src/main/java/org/bitbiome/commands/CommandListener.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/main/java/org/bitbiome/commands/CommandListener.java b/src/main/java/org/bitbiome/commands/CommandListener.java index 5a9bcfe..fdb5ce4 100644 --- a/src/main/java/org/bitbiome/commands/CommandListener.java +++ b/src/main/java/org/bitbiome/commands/CommandListener.java @@ -18,10 +18,6 @@ public class CommandListener { commands.put("blackjack", new BlackJackCommand()); } - public HashMap returnCommands() { - return commands; - } - public boolean perform(String command, Scanner scanner, boolean isRunning, String message) { From eab3f7bda10dc68b1628846408362abe7ec514ab Mon Sep 17 00:00:00 2001 From: Friederike von Gruben Date: Mon, 6 Feb 2023 14:03:39 +0100 Subject: [PATCH 111/152] Created BlackJack class --- src/main/java/org/bitbiome/classes/BlackJack.java | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 src/main/java/org/bitbiome/classes/BlackJack.java diff --git a/src/main/java/org/bitbiome/classes/BlackJack.java b/src/main/java/org/bitbiome/classes/BlackJack.java new file mode 100644 index 0000000..3af2dc4 --- /dev/null +++ b/src/main/java/org/bitbiome/classes/BlackJack.java @@ -0,0 +1,4 @@ +package org.bitbiome.classes; + +public class BlackJack { +} From 37570a200cb69ddd638a157539efe37758ec8a69 Mon Sep 17 00:00:00 2001 From: Friederike von Gruben Date: Mon, 6 Feb 2023 14:04:35 +0100 Subject: [PATCH 112/152] Created enum in BlackJack This is for the PLAYER and BOT --- .../java/org/bitbiome/classes/BlackJack.java | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/src/main/java/org/bitbiome/classes/BlackJack.java b/src/main/java/org/bitbiome/classes/BlackJack.java index 3af2dc4..dbc3386 100644 --- a/src/main/java/org/bitbiome/classes/BlackJack.java +++ b/src/main/java/org/bitbiome/classes/BlackJack.java @@ -1,4 +1,35 @@ package org.bitbiome.classes; public class BlackJack { + + public enum Entity { + PLAYER(1), BOT(2); + private int value; + + private Entity(int value) { + this.value = value; + } + + public int getValue() { + return value; + } + //Just for testing from some SO answers, but no use + public void setValue(int value) { + this.value = value; + } + + public static Entity getEventStatusById(int id) { + + Entity entity = null; + + switch (id) { + case 1 -> entity = PLAYER; + case 2 -> entity = BOT; + default -> { + } + } + return entity; + } + } + } From 1e8a16c14d86933d305b5db172a7d3716c2db61c Mon Sep 17 00:00:00 2001 From: Friederike von Gruben Date: Mon, 6 Feb 2023 14:05:35 +0100 Subject: [PATCH 113/152] Created BlackJack constructor Set playername --- src/main/java/org/bitbiome/classes/BlackJack.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/java/org/bitbiome/classes/BlackJack.java b/src/main/java/org/bitbiome/classes/BlackJack.java index dbc3386..c0bc92b 100644 --- a/src/main/java/org/bitbiome/classes/BlackJack.java +++ b/src/main/java/org/bitbiome/classes/BlackJack.java @@ -32,4 +32,10 @@ public class BlackJack { } } + private String playerName; + + public BlackJack(String playerName) { + this.playerName = playerName; + } + } From f5aa351958c2543ced8deb60b0210af0421dec4a Mon Sep 17 00:00:00 2001 From: Friederike von Gruben Date: Mon, 6 Feb 2023 14:06:07 +0100 Subject: [PATCH 114/152] Edited BlackJack constructor Set playerPoints --- src/main/java/org/bitbiome/classes/BlackJack.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/org/bitbiome/classes/BlackJack.java b/src/main/java/org/bitbiome/classes/BlackJack.java index c0bc92b..e69c7f5 100644 --- a/src/main/java/org/bitbiome/classes/BlackJack.java +++ b/src/main/java/org/bitbiome/classes/BlackJack.java @@ -33,9 +33,11 @@ public class BlackJack { } private String playerName; + private int playerPoints; public BlackJack(String playerName) { this.playerName = playerName; + this.playerPoints = 0; } } From b17b3bc18a237c11b7610df36174b77f34e1ab6b Mon Sep 17 00:00:00 2001 From: Friederike von Gruben Date: Mon, 6 Feb 2023 14:06:35 +0100 Subject: [PATCH 115/152] Edited BlackJack constructor Set botPoints --- src/main/java/org/bitbiome/classes/BlackJack.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/org/bitbiome/classes/BlackJack.java b/src/main/java/org/bitbiome/classes/BlackJack.java index e69c7f5..a3ac081 100644 --- a/src/main/java/org/bitbiome/classes/BlackJack.java +++ b/src/main/java/org/bitbiome/classes/BlackJack.java @@ -34,10 +34,12 @@ public class BlackJack { private String playerName; private int playerPoints; + private int botPoints; public BlackJack(String playerName) { this.playerName = playerName; this.playerPoints = 0; + this.botPoints = 0; } } From 673372adcabeb8460bae2dc2b71db1e872f076fd Mon Sep 17 00:00:00 2001 From: Friederike von Gruben Date: Mon, 6 Feb 2023 14:07:16 +0100 Subject: [PATCH 116/152] Edited BlackJack constructor Set playerIn = true --- src/main/java/org/bitbiome/classes/BlackJack.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/org/bitbiome/classes/BlackJack.java b/src/main/java/org/bitbiome/classes/BlackJack.java index a3ac081..bc17c37 100644 --- a/src/main/java/org/bitbiome/classes/BlackJack.java +++ b/src/main/java/org/bitbiome/classes/BlackJack.java @@ -35,11 +35,13 @@ public class BlackJack { private String playerName; private int playerPoints; private int botPoints; + private boolean playerIn; public BlackJack(String playerName) { this.playerName = playerName; this.playerPoints = 0; this.botPoints = 0; + this.playerIn = true; } } From 04d9439db68d8e3c3ee29ea4a96513b3387933e9 Mon Sep 17 00:00:00 2001 From: Friederike von Gruben Date: Mon, 6 Feb 2023 14:07:46 +0100 Subject: [PATCH 117/152] Edited BlackJack constructor Set botIn = true --- src/main/java/org/bitbiome/classes/BlackJack.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/org/bitbiome/classes/BlackJack.java b/src/main/java/org/bitbiome/classes/BlackJack.java index bc17c37..e004bde 100644 --- a/src/main/java/org/bitbiome/classes/BlackJack.java +++ b/src/main/java/org/bitbiome/classes/BlackJack.java @@ -36,12 +36,14 @@ public class BlackJack { private int playerPoints; private int botPoints; private boolean playerIn; + private boolean botIn; public BlackJack(String playerName) { this.playerName = playerName; this.playerPoints = 0; this.botPoints = 0; this.playerIn = true; + this.botIn = true; } } From b16aab62c5ff80abdf19d17041aa625305282999 Mon Sep 17 00:00:00 2001 From: Friederike von Gruben Date: Mon, 6 Feb 2023 14:09:35 +0100 Subject: [PATCH 118/152] Added getPlayerName() to BlackJack --- src/main/java/org/bitbiome/classes/BlackJack.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/org/bitbiome/classes/BlackJack.java b/src/main/java/org/bitbiome/classes/BlackJack.java index e004bde..5a0a341 100644 --- a/src/main/java/org/bitbiome/classes/BlackJack.java +++ b/src/main/java/org/bitbiome/classes/BlackJack.java @@ -46,4 +46,7 @@ public class BlackJack { this.botIn = true; } + public String getPlayerName(Entity entity) { + return entity == Entity.PLAYER ? playerName : "BitBiome"; + } } From 905e5975abc31b54e5e66e32ce51eff15b4cfbe5 Mon Sep 17 00:00:00 2001 From: Friederike von Gruben Date: Mon, 6 Feb 2023 14:10:08 +0100 Subject: [PATCH 119/152] Added getPoints() to BlackJack This method returns the points from the bot or the player --- src/main/java/org/bitbiome/classes/BlackJack.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/org/bitbiome/classes/BlackJack.java b/src/main/java/org/bitbiome/classes/BlackJack.java index 5a0a341..b4ed1f9 100644 --- a/src/main/java/org/bitbiome/classes/BlackJack.java +++ b/src/main/java/org/bitbiome/classes/BlackJack.java @@ -49,4 +49,8 @@ public class BlackJack { public String getPlayerName(Entity entity) { return entity == Entity.PLAYER ? playerName : "BitBiome"; } + + public int getPoints(Entity entity) { + return entity == Entity.PLAYER ? playerPoints : botPoints; + } } From 09e3cdce30185b88c731d60e887b25fd8ce19936 Mon Sep 17 00:00:00 2001 From: Friederike von Gruben Date: Mon, 6 Feb 2023 14:10:40 +0100 Subject: [PATCH 120/152] Added isIn() to BlackJack This method returns whether the bot or the player is in the game --- src/main/java/org/bitbiome/classes/BlackJack.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/org/bitbiome/classes/BlackJack.java b/src/main/java/org/bitbiome/classes/BlackJack.java index b4ed1f9..dfb791c 100644 --- a/src/main/java/org/bitbiome/classes/BlackJack.java +++ b/src/main/java/org/bitbiome/classes/BlackJack.java @@ -53,4 +53,8 @@ public class BlackJack { public int getPoints(Entity entity) { return entity == Entity.PLAYER ? playerPoints : botPoints; } + + public boolean isIn(Entity entity) { + return entity == Entity.PLAYER ? playerIn : botIn; + } } From 07921299906b9e679caa093a5559aa2adee04e51 Mon Sep 17 00:00:00 2001 From: Friederike von Gruben Date: Mon, 6 Feb 2023 14:11:20 +0100 Subject: [PATCH 121/152] Added getEntity() to BlackJack This method returns the Entity by the enum --- src/main/java/org/bitbiome/classes/BlackJack.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/org/bitbiome/classes/BlackJack.java b/src/main/java/org/bitbiome/classes/BlackJack.java index dfb791c..b1bfce8 100644 --- a/src/main/java/org/bitbiome/classes/BlackJack.java +++ b/src/main/java/org/bitbiome/classes/BlackJack.java @@ -57,4 +57,8 @@ public class BlackJack { public boolean isIn(Entity entity) { return entity == Entity.PLAYER ? playerIn : botIn; } + + public Entity getEntity(int ID) { + return Entity.getEventStatusById(ID); + } } From 5239962efeaed496428b6517c12a425f048489f0 Mon Sep 17 00:00:00 2001 From: Friederike von Gruben Date: Mon, 6 Feb 2023 14:11:53 +0100 Subject: [PATCH 122/152] Added addPoints() to BlackJack This method adds points to the player or the bot --- src/main/java/org/bitbiome/classes/BlackJack.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/org/bitbiome/classes/BlackJack.java b/src/main/java/org/bitbiome/classes/BlackJack.java index b1bfce8..60c33ec 100644 --- a/src/main/java/org/bitbiome/classes/BlackJack.java +++ b/src/main/java/org/bitbiome/classes/BlackJack.java @@ -61,4 +61,9 @@ public class BlackJack { public Entity getEntity(int ID) { return Entity.getEventStatusById(ID); } + + public void addPoints(Entity entity, int points) { + if (entity == Entity.BOT) botPoints += points; + if (entity == Entity.PLAYER) playerPoints += points; + } } From 0b3ef70def0b30900e646f7d7ddbaf2e8b408171 Mon Sep 17 00:00:00 2001 From: Friederike von Gruben Date: Mon, 6 Feb 2023 14:12:48 +0100 Subject: [PATCH 123/152] Added botWantsToPlay() to BlackJack This method returns a boolean whether the bot wants to play or not specified by the points he has currently --- .../java/org/bitbiome/classes/BlackJack.java | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/main/java/org/bitbiome/classes/BlackJack.java b/src/main/java/org/bitbiome/classes/BlackJack.java index 60c33ec..9df3478 100644 --- a/src/main/java/org/bitbiome/classes/BlackJack.java +++ b/src/main/java/org/bitbiome/classes/BlackJack.java @@ -1,5 +1,7 @@ package org.bitbiome.classes; +import java.util.Random; + public class BlackJack { public enum Entity { @@ -66,4 +68,25 @@ public class BlackJack { if (entity == Entity.BOT) botPoints += points; if (entity == Entity.PLAYER) playerPoints += points; } + + public boolean botWantsToPlay() { + if (botIn) { + if (botPoints <= 10) { + return true; + } else if (botPoints <= 17) { + int r = new Random().nextInt(1, 9); + if (r <= 3) { + botIn = false; + return false; + } else { + return true; + } + } else { + botIn = false; + return false; + } + } else { + return false; + } + } } From 4897a2321cf504b1bfab3747972f2522323791dc Mon Sep 17 00:00:00 2001 From: Friederike von Gruben Date: Mon, 6 Feb 2023 14:13:19 +0100 Subject: [PATCH 124/152] Added playerOut() to BlackJack This method sets the current playerIn state to false --- src/main/java/org/bitbiome/classes/BlackJack.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/org/bitbiome/classes/BlackJack.java b/src/main/java/org/bitbiome/classes/BlackJack.java index 9df3478..19d210e 100644 --- a/src/main/java/org/bitbiome/classes/BlackJack.java +++ b/src/main/java/org/bitbiome/classes/BlackJack.java @@ -89,4 +89,8 @@ public class BlackJack { return false; } } + + public void playerOut() { + this.playerIn = false; + } } From b1c0059a7494004896fad6f082291ead77ea3b0b Mon Sep 17 00:00:00 2001 From: Friederike von Gruben Date: Mon, 6 Feb 2023 14:32:13 +0100 Subject: [PATCH 125/152] Added methods and stuff to BlackJackCommand The blackjack game works now --- .../bitbiome/commands/BlackJackCommand.java | 100 +++++++++++++++++- 1 file changed, 98 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/bitbiome/commands/BlackJackCommand.java b/src/main/java/org/bitbiome/commands/BlackJackCommand.java index 734f6b6..52e854a 100644 --- a/src/main/java/org/bitbiome/commands/BlackJackCommand.java +++ b/src/main/java/org/bitbiome/commands/BlackJackCommand.java @@ -1,12 +1,108 @@ package org.bitbiome.commands; +import org.bitbiome.classes.BlackJack; + +import java.util.Random; import java.util.Scanner; public class BlackJackCommand implements CommandAPI { - + private boolean over; @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"); + + 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!\nViel Spaß!"); + + over = false; + spielen(); + } + + public void spielen() { + BlackJack bj = new BlackJack("Dave"); + Scanner sc = new Scanner(System.in); + BlackJack.Entity player = bj.getEntity(1); + while (!over) { + int r = new Random().nextInt(4, 11); + bj.addPoints(player, r); + System.out.println(bj.getPlayerName(player) + " hat " + r + " bekommen. Er hat insgesamt " + bj.getPoints(player) + "."); + + if (bj.getPoints(player) >= 21) { + over21(player, bj); + has21(player, bj); + over = true; + break; + } + System.out.print("Weiter?"); + + if (player == BlackJack.Entity.BOT) { + if (bj.botWantsToPlay()) { + System.out.println("Na klar!"); + } else { + System.out.println("Nope, ich bin fertig."); + } + } else { + String eingabe = sc.nextLine(); + if (!eingabe.toLowerCase().startsWith("j")) { + bj.playerOut(); + } + } + + + player = switchPlayer(player, bj); + + } + } + + public void over21(BlackJack.Entity player, BlackJack bj) { + if (bj.getPoints(player) > 21) { + over = true; + System.out.println(bj.getPlayerName(player) + " hat über 21 Punkte und damit verloren."); + } + + } + + + public void has21(BlackJack.Entity player, BlackJack bj) { + if (bj.getPoints(player) == 21) { + System.out.println(bj.getPlayerName(player) + " hat gewonnen! Du hast 21 Punkte!"); + over = true; + } + } + + public BlackJack.Entity switchPlayer(BlackJack.Entity player, BlackJack bj) { + BlackJack.Entity BOT = BlackJack.Entity.BOT; + BlackJack.Entity PLAYER = BlackJack.Entity.PLAYER; + if (bj.isIn(BOT) || bj.isIn(PLAYER)) { + if (player == PLAYER) { + if (bj.isIn(BOT)) { + return BOT; + } + return PLAYER; + } else { + if (bj.isIn(PLAYER)) { + return PLAYER; + } + return BOT; + } + } else { + over = true; + getWinner(bj); + return null; + } + } + + + public void getWinner(BlackJack bj) { + BlackJack.Entity entity; + if (bj.getPoints(BlackJack.Entity.BOT) < bj.getPoints(BlackJack.Entity.PLAYER)) { + entity = BlackJack.Entity.PLAYER; + System.out.println(bj.getPlayerName(entity) + " hat gewonnen, da er mehr Punkte hat!"); + } else if (bj.getPoints(BlackJack.Entity.BOT) == bj.getPoints(BlackJack.Entity.PLAYER)){ + System.out.println("Es ist Gleichstand!"); + } else { + entity = BlackJack.Entity.BOT; + System.out.println(bj.getPlayerName(entity) + " hat gewonnen, da er mehr Punkte hat!"); + } + } } \ No newline at end of file From c558b1287cd5a47f01ebfe6d851eb62ad53df080 Mon Sep 17 00:00:00 2001 From: Friederike von Gruben Date: Mon, 6 Feb 2023 14:51:06 +0100 Subject: [PATCH 126/152] unittest: Created BlackJackTest This test tests the Entity ID from the Player --- .../org/bitbiome/classes/BlackJackTest.java | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/test/java/org/bitbiome/classes/BlackJackTest.java diff --git a/src/test/java/org/bitbiome/classes/BlackJackTest.java b/src/test/java/org/bitbiome/classes/BlackJackTest.java new file mode 100644 index 0000000..35247ff --- /dev/null +++ b/src/test/java/org/bitbiome/classes/BlackJackTest.java @@ -0,0 +1,20 @@ +package org.bitbiome.classes; + +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +public class BlackJackTest { + + private static BlackJack bj; + @BeforeAll + public static void setUpTest() { + bj = new BlackJack("UnitTest"); + } + @Test + public void testGetEntity() { + assertEquals(BlackJack.Entity.PLAYER, bj.getEntity(1)); + } + +} From 9edfb370d379aec6b06298d8a3910f751a9b0161 Mon Sep 17 00:00:00 2001 From: Friederike von Gruben Date: Mon, 6 Feb 2023 14:52:01 +0100 Subject: [PATCH 127/152] unittest: Added test to BlackJackTest This test tests the entity ID of the bot --- src/test/java/org/bitbiome/classes/BlackJackTest.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/test/java/org/bitbiome/classes/BlackJackTest.java b/src/test/java/org/bitbiome/classes/BlackJackTest.java index 35247ff..be098bc 100644 --- a/src/test/java/org/bitbiome/classes/BlackJackTest.java +++ b/src/test/java/org/bitbiome/classes/BlackJackTest.java @@ -17,4 +17,9 @@ public class BlackJackTest { assertEquals(BlackJack.Entity.PLAYER, bj.getEntity(1)); } + @Test + public void testGetEntityBot() { + assertEquals(BlackJack.Entity.BOT, bj.getEntity(2)); + } + } From c6d9d282a1be2561615a820804898c5ec6a3b77a Mon Sep 17 00:00:00 2001 From: Friederike von Gruben Date: Mon, 6 Feb 2023 14:53:21 +0100 Subject: [PATCH 128/152] unittest: Added test to BlackJackTest This tests the playername --- src/test/java/org/bitbiome/classes/BlackJackTest.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/test/java/org/bitbiome/classes/BlackJackTest.java b/src/test/java/org/bitbiome/classes/BlackJackTest.java index be098bc..bc4a408 100644 --- a/src/test/java/org/bitbiome/classes/BlackJackTest.java +++ b/src/test/java/org/bitbiome/classes/BlackJackTest.java @@ -22,4 +22,9 @@ public class BlackJackTest { assertEquals(BlackJack.Entity.BOT, bj.getEntity(2)); } + @Test + public void testPlayerName() { + assertEquals("UnitTest", bj.getPlayerName(BlackJack.Entity.PLAYER)); + } + } From 44b4ac4d9b11174a2509c105196ce0229ce537a5 Mon Sep 17 00:00:00 2001 From: Friederike von Gruben Date: Mon, 6 Feb 2023 14:53:54 +0100 Subject: [PATCH 129/152] unittest: Added test to BlackJackTest This tests the bot name of BlackJack --- src/test/java/org/bitbiome/classes/BlackJackTest.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/test/java/org/bitbiome/classes/BlackJackTest.java b/src/test/java/org/bitbiome/classes/BlackJackTest.java index bc4a408..d6da1c2 100644 --- a/src/test/java/org/bitbiome/classes/BlackJackTest.java +++ b/src/test/java/org/bitbiome/classes/BlackJackTest.java @@ -27,4 +27,9 @@ public class BlackJackTest { assertEquals("UnitTest", bj.getPlayerName(BlackJack.Entity.PLAYER)); } + @Test + public void testBotName() { + assertEquals("BitBiome", bj.getPlayerName(BlackJack.Entity.BOT)); + } + } From bfe11ff7d9b92ba2085170e4554835b80c1a6270 Mon Sep 17 00:00:00 2001 From: Friederike von Gruben Date: Mon, 6 Feb 2023 14:56:25 +0100 Subject: [PATCH 130/152] unittest: Added test to BlackJackTest This tests whether the player is in the game or not --- src/test/java/org/bitbiome/classes/BlackJackTest.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/test/java/org/bitbiome/classes/BlackJackTest.java b/src/test/java/org/bitbiome/classes/BlackJackTest.java index d6da1c2..0534913 100644 --- a/src/test/java/org/bitbiome/classes/BlackJackTest.java +++ b/src/test/java/org/bitbiome/classes/BlackJackTest.java @@ -4,6 +4,7 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; public class BlackJackTest { @@ -32,4 +33,9 @@ public class BlackJackTest { assertEquals("BitBiome", bj.getPlayerName(BlackJack.Entity.BOT)); } + @Test + public void testPlayerIsIn() { + assertTrue(bj.isIn(BlackJack.Entity.PLAYER)); + } + } From c08df3bc8f4ca92263ffeced2ed0796712f139b2 Mon Sep 17 00:00:00 2001 From: Friederike von Gruben Date: Mon, 6 Feb 2023 14:59:11 +0100 Subject: [PATCH 131/152] unittest: Added test to BlackJackTest This tests whether the bot is in the game or not --- src/test/java/org/bitbiome/classes/BlackJackTest.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/test/java/org/bitbiome/classes/BlackJackTest.java b/src/test/java/org/bitbiome/classes/BlackJackTest.java index 0534913..30752e0 100644 --- a/src/test/java/org/bitbiome/classes/BlackJackTest.java +++ b/src/test/java/org/bitbiome/classes/BlackJackTest.java @@ -3,8 +3,7 @@ package org.bitbiome.classes; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.*; public class BlackJackTest { @@ -38,4 +37,8 @@ public class BlackJackTest { assertTrue(bj.isIn(BlackJack.Entity.PLAYER)); } + @Test + public void testBotIsIn() { + assertTrue(bj.isIn(BlackJack.Entity.BOT)); + } } From d9d97cd7c294abe9ec2da37d4cf554e3be00593c Mon Sep 17 00:00:00 2001 From: David Hermann Date: Tue, 7 Feb 2023 12:16:09 +0100 Subject: [PATCH 132/152] Hotfix for merge --- src/main/java/org/bitbiome/Boot.java | 3 +- .../org/bitbiome/classes/InteractionLoop.java | 4 +-- .../java/org/bitbiome/classes/JsonParser.java | 19 +----------- .../org/bitbiome/classes/TravelEngine.java | 11 +++---- .../bitbiome/commands/BlackJackCommand.java | 3 +- .../org/bitbiome/commands/QuizCommand.java | 12 ++++--- .../java/org/bitbiome/entities/Player.java | 5 ++- src/main/resources/playerconfig.json | 31 ++++++++++--------- src/main/resources/quiz.json | 2 +- 9 files changed, 36 insertions(+), 54 deletions(-) diff --git a/src/main/java/org/bitbiome/Boot.java b/src/main/java/org/bitbiome/Boot.java index 0f5ebdd..4852196 100644 --- a/src/main/java/org/bitbiome/Boot.java +++ b/src/main/java/org/bitbiome/Boot.java @@ -26,8 +26,7 @@ public class Boot { private Player getPlayerSave() { String name; - JsonParser jp = new JsonParser(); - JSONObject playerconfig = jp.getJSONObject("playerconfig.json"); + JSONObject playerconfig = JsonParser.getJSONObject("src/main/resources/playerconfig.json"); name = playerconfig.getString("name"); return new Player(name); } diff --git a/src/main/java/org/bitbiome/classes/InteractionLoop.java b/src/main/java/org/bitbiome/classes/InteractionLoop.java index f8a6c84..4948f5c 100644 --- a/src/main/java/org/bitbiome/classes/InteractionLoop.java +++ b/src/main/java/org/bitbiome/classes/InteractionLoop.java @@ -40,10 +40,10 @@ public class InteractionLoop { + Colors.ANSI_RESET); String name = input.nextLine(); JsonParser jp = new JsonParser(); - JSONObject playerconf = jp.getJSONObject("playerconfig.json"); + JSONObject playerconf = JsonParser.getJSONObject("src/main/resources/playerconfig.json"); playerconf.put("name", name); travelEngine.getPlayer().setName(name); - jp.writeObject("playerconfig.json", playerconf); + JsonParser.writeObject("src/main/resources/playerconfig.json", playerconf); } } diff --git a/src/main/java/org/bitbiome/classes/JsonParser.java b/src/main/java/org/bitbiome/classes/JsonParser.java index e7ad5b7..d9657e1 100644 --- a/src/main/java/org/bitbiome/classes/JsonParser.java +++ b/src/main/java/org/bitbiome/classes/JsonParser.java @@ -1,13 +1,10 @@ package org.bitbiome.classes; import org.json.JSONObject; -import org.json.JSONTokener; import java.io.FileWriter; import java.io.IOException; import java.io.FileReader; -import java.io.InputStream; - public class JsonParser { @@ -26,7 +23,7 @@ public class JsonParser { https://github.com/stleary/JSON-java */ - public static JSONObject readJSONFile(String filePath) { + public static JSONObject getJSONObject(String filePath) { StringBuilder sb = null; try { FileReader reader = new FileReader(filePath); @@ -58,18 +55,4 @@ public class JsonParser { throw new RuntimeException(e); } } - - public void writeObject(String fileName, JSONObject object) { - - String resourceName = System.getProperty("user.dir") + "/src/main/resources/" + fileName; - try { - FileWriter fw = new FileWriter(resourceName, false); - fw.write(object.toString(1)); - fw.close(); - } catch (IOException e) { - throw new RuntimeException(e); - } - - - } } diff --git a/src/main/java/org/bitbiome/classes/TravelEngine.java b/src/main/java/org/bitbiome/classes/TravelEngine.java index a8d3213..0573cd9 100644 --- a/src/main/java/org/bitbiome/classes/TravelEngine.java +++ b/src/main/java/org/bitbiome/classes/TravelEngine.java @@ -10,21 +10,19 @@ import java.util.ArrayList; public class TravelEngine { private JSONArray locations; - private JsonParser jp; private Player player; public TravelEngine(Player player) { - jp = new JsonParser(); - locations = jp.getJSONObject("gameconfig.json").getJSONArray("locations"); + locations = JsonParser.getJSONObject("src/main/resources/gameconfig.json").getJSONArray("locations"); this.player = player; } public void travelTo(Location location) { player.setLocation(location); - JSONObject jObj = jp.getJSONObject("playerconfig.json"); + JSONObject jObj = JsonParser.getJSONObject("src/main/resources/playerconfig.json"); jObj.put("currentLocation", location.getName()); - jp.writeObject("playerconfig.json", jObj); + JsonParser.writeObject("src/main/resources/playerconfig.json", jObj); } public Player getPlayer() { @@ -45,8 +43,7 @@ public class TravelEngine { } public Location getLocationByName(String name) { - JsonParser jp = new JsonParser(); - JSONObject gameconfig = jp.getJSONObject("gameconfig.json"); + JSONObject gameconfig = JsonParser.getJSONObject("src/main/resources/gameconfig.json"); JSONArray locations = gameconfig.getJSONArray("locations"); JSONObject location = null; if (locationExists(name)) { diff --git a/src/main/java/org/bitbiome/commands/BlackJackCommand.java b/src/main/java/org/bitbiome/commands/BlackJackCommand.java index 52e854a..9794e95 100644 --- a/src/main/java/org/bitbiome/commands/BlackJackCommand.java +++ b/src/main/java/org/bitbiome/commands/BlackJackCommand.java @@ -2,6 +2,7 @@ package org.bitbiome.commands; import org.bitbiome.classes.BlackJack; +import org.bitbiome.classes.TravelEngine; import java.util.Random; import java.util.Scanner; @@ -9,7 +10,7 @@ import java.util.Scanner; public class BlackJackCommand implements CommandAPI { private boolean over; @Override - public void performCommand(Scanner scanner, boolean isRunning, String message) { + public void performCommand(Scanner scanner, boolean isRunning, String message, TravelEngine travelEngine) { 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!\nViel Spaß!"); diff --git a/src/main/java/org/bitbiome/commands/QuizCommand.java b/src/main/java/org/bitbiome/commands/QuizCommand.java index db0316e..59d215f 100644 --- a/src/main/java/org/bitbiome/commands/QuizCommand.java +++ b/src/main/java/org/bitbiome/commands/QuizCommand.java @@ -4,6 +4,8 @@ package org.bitbiome.commands; import org.bitbiome.classes.JsonParser; import org.json.JSONArray; import org.json.JSONObject; +import org.bitbiome.classes.TravelEngine; + import java.util.Date; import java.util.Random; @@ -12,11 +14,11 @@ import java.util.Scanner; public class QuizCommand implements CommandAPI { private Scanner quizScanner; @Override - public void performCommand(Scanner scanner, boolean isRunning, String message) { + public void performCommand(Scanner scanner, boolean isRunning, String message, TravelEngine travelEngine) { quizScanner = new Scanner(System.in); - String path = "src\\main\\resources\\quiz.json"; - JSONObject quiz = JsonParser.readJSONFile(path); + String path = "src/main/resources/quiz.json"; + JSONObject quiz = JsonParser.getJSONObject(path); long diffTime = canPlayAgain(quiz.getLong("lastPlayed")); if (diffTime > 0) { @@ -76,8 +78,8 @@ public class QuizCommand implements CommandAPI { } public static int addGold() { - String playerpath = "src\\main\\resources\\playerconfig.json"; - JSONObject playerconfig = JsonParser.readJSONFile(playerpath); + String playerpath = "src/main/resources/ssplayerconfig.json"; + JSONObject playerconfig = JsonParser.getJSONObject(playerpath); int gold = playerconfig.getInt("gold"); gold = gold + 5; playerconfig.put("gold", gold); diff --git a/src/main/java/org/bitbiome/entities/Player.java b/src/main/java/org/bitbiome/entities/Player.java index 3d46e17..72a903c 100644 --- a/src/main/java/org/bitbiome/entities/Player.java +++ b/src/main/java/org/bitbiome/entities/Player.java @@ -12,13 +12,12 @@ public class Player { private ArrayList inventory; - private JsonParser jp; + public Player(String name) { - jp = new JsonParser(); this.name = name; hp = 100.0F; - location = new Location(jp.getJSONObject("playerconfig.json").getString("currentLocation"), new ArrayList<>(), new ArrayList<>()); + location = new Location(JsonParser.getJSONObject("src/main/resources/playerconfig.json").getString("currentLocation"), new ArrayList<>(), new ArrayList<>()); inventory = new ArrayList<>(); } diff --git a/src/main/resources/playerconfig.json b/src/main/resources/playerconfig.json index 1a2c55e..9da94a1 100644 --- a/src/main/resources/playerconfig.json +++ b/src/main/resources/playerconfig.json @@ -1,17 +1,18 @@ { - "name": "null", - "gold": 0, - "hp": 10, - "currentLocation": "Wald", - "inventory": [ - { - "name": "Holz", - "amount": "5", - "durability": 1000 - },{ - "name": "Stein", - "amount": "5", - "durability": 1000 - } - ] + "gold": 0, + "name": "Dave", + "hp": 10, + "inventory": [ + { + "amount": "5", + "durability": 1000, + "name": "Holz" + }, + { + "amount": "5", + "durability": 1000, + "name": "Stein" + } + ], + "currentLocation": "Wald" } \ No newline at end of file diff --git a/src/main/resources/quiz.json b/src/main/resources/quiz.json index a36366a..ae61307 100644 --- a/src/main/resources/quiz.json +++ b/src/main/resources/quiz.json @@ -201,5 +201,5 @@ ] } ], - "lastPlayed": 0 + "lastPlayed": 1675768444160 } \ No newline at end of file From ac7332a845b3cbc8c5aa262f767b98e8b32497df Mon Sep 17 00:00:00 2001 From: David Hermann Date: Tue, 7 Feb 2023 12:29:09 +0100 Subject: [PATCH 133/152] Resource Leak fixed --- src/main/java/org/bitbiome/classes/InteractionLoop.java | 1 - src/main/java/org/bitbiome/commands/BlackJackCommand.java | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/bitbiome/classes/InteractionLoop.java b/src/main/java/org/bitbiome/classes/InteractionLoop.java index 4948f5c..ee504d6 100644 --- a/src/main/java/org/bitbiome/classes/InteractionLoop.java +++ b/src/main/java/org/bitbiome/classes/InteractionLoop.java @@ -39,7 +39,6 @@ public class InteractionLoop { + "Oh, ein Fremder!\nBist du bereit für dein womöglich größtes Abenteuer?\nDann sag mir doch zunächst wie du heißt: " + Colors.ANSI_RESET); String name = input.nextLine(); - JsonParser jp = new JsonParser(); JSONObject playerconf = JsonParser.getJSONObject("src/main/resources/playerconfig.json"); playerconf.put("name", name); travelEngine.getPlayer().setName(name); diff --git a/src/main/java/org/bitbiome/commands/BlackJackCommand.java b/src/main/java/org/bitbiome/commands/BlackJackCommand.java index 9794e95..bc8381b 100644 --- a/src/main/java/org/bitbiome/commands/BlackJackCommand.java +++ b/src/main/java/org/bitbiome/commands/BlackJackCommand.java @@ -17,10 +17,10 @@ public class BlackJackCommand implements CommandAPI { over = false; spielen(); } - + Scanner sc; public void spielen() { BlackJack bj = new BlackJack("Dave"); - Scanner sc = new Scanner(System.in); + sc = new Scanner(System.in); BlackJack.Entity player = bj.getEntity(1); while (!over) { int r = new Random().nextInt(4, 11); From e84c2f9b7556123dfc937ede0ca1a8df8da453f9 Mon Sep 17 00:00:00 2001 From: David Hermann Date: Tue, 7 Feb 2023 12:47:51 +0100 Subject: [PATCH 134/152] Edited helpcommand Added quiz and blackjack --- .../org/bitbiome/commands/HelpCommand.java | 4 ++++ .../org/bitbiome/commands/HelpCommandTest.java | 18 ++---------------- 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/src/main/java/org/bitbiome/commands/HelpCommand.java b/src/main/java/org/bitbiome/commands/HelpCommand.java index ee4f237..ed5fd59 100644 --- a/src/main/java/org/bitbiome/commands/HelpCommand.java +++ b/src/main/java/org/bitbiome/commands/HelpCommand.java @@ -27,6 +27,10 @@ public class HelpCommand implements CommandAPI { .append("|--------------|-----------------------------|\n") .append("|" + Colors.ANSI_GREEN + " travel" + Colors.ANSI_RESET + " | Startet das Reise System |\n") .append("|--------------|-----------------------------|\n") + .append("|" + Colors.ANSI_GREEN + " quiz" + Colors.ANSI_RESET + " | Startet das quiz im shop |\n") + .append("|--------------|-----------------------------|\n") + .append("|" + Colors.ANSI_GREEN + " blackjack" + Colors.ANSI_RESET + " | Startet blackjack im shop |\n") + .append("|--------------|-----------------------------|\n") .append("|" + Colors.ANSI_GREEN + " location" + Colors.ANSI_RESET + " | Gibt deine Location aus |\n") .append("|______________|_____________________________|\n"); diff --git a/src/test/java/org/bitbiome/commands/HelpCommandTest.java b/src/test/java/org/bitbiome/commands/HelpCommandTest.java index 5caac07..a65225f 100644 --- a/src/test/java/org/bitbiome/commands/HelpCommandTest.java +++ b/src/test/java/org/bitbiome/commands/HelpCommandTest.java @@ -1,8 +1,7 @@ package org.bitbiome.commands; -import org.bitbiome.classes.Colors; import org.junit.jupiter.api.Test; -import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; public class HelpCommandTest { @@ -10,20 +9,7 @@ public class HelpCommandTest { @Test public void testHelpCommand() { String helpMessage = HelpCommand.getHelpMessage(); - StringBuilder outputMessage = new StringBuilder(); - outputMessage - .append("|______________|_____________________________|\n") - .append("|" + Colors.ANSI_PURPLE + " Command" + Colors.ANSI_RESET + " | " + Colors.ANSI_PURPLE + "Description" + Colors.ANSI_RESET + " |\n") - .append("|--------------|-----------------------------|\n") - .append("|" + Colors.ANSI_GREEN + " help" + Colors.ANSI_RESET + " | Gibt diese Nachricht aus |\n") - .append("|--------------|-----------------------------|\n") - .append("|" + Colors.ANSI_GREEN + " exit/quit" + Colors.ANSI_RESET + " | Beendet das Spiel |\n") - .append("|--------------|-----------------------------|\n") - .append("|" + Colors.ANSI_GREEN + " travel" + Colors.ANSI_RESET + " | Startet das Reise System |\n") - .append("|--------------|-----------------------------|\n") - .append("|" + Colors.ANSI_GREEN + " location" + Colors.ANSI_RESET + " | Gibt deine Location aus |\n") - .append("|______________|_____________________________|\n"); - assertEquals(outputMessage.toString(), helpMessage); + assertTrue(helpMessage.contains("Command") && helpMessage.contains("Description")); } From 3fe4b03d9e426a5237dd12cae7063df4e35ae6d9 Mon Sep 17 00:00:00 2001 From: Max Gerbeth Date: Tue, 7 Feb 2023 13:15:52 +0100 Subject: [PATCH 135/152] integrate quiz and blackjack into shop --- .../bitbiome/commands/CommandListener.java | 3 --- .../org/bitbiome/commands/QuizCommand.java | 6 ++--- .../org/bitbiome/commands/ShopCommand.java | 15 ++++++++--- src/main/java/org/bitbiome/shop/Shop.java | 26 +++++++++++++++++-- .../bitbiome/commands/ShopCommandTest.java | 4 +-- 5 files changed, 40 insertions(+), 14 deletions(-) diff --git a/src/main/java/org/bitbiome/commands/CommandListener.java b/src/main/java/org/bitbiome/commands/CommandListener.java index bd1e520..159785f 100644 --- a/src/main/java/org/bitbiome/commands/CommandListener.java +++ b/src/main/java/org/bitbiome/commands/CommandListener.java @@ -18,9 +18,6 @@ public class CommandListener { commands.put("quit", new QuitCommand()); commands.put("location", new LocationCommand()); commands.put("travel", new TravelCommand()); - commands.put("quiz", new QuizCommand()); - commands.put("blackjack", new BlackJackCommand()); - commands.put("shop", new ShopCommand()); } diff --git a/src/main/java/org/bitbiome/commands/QuizCommand.java b/src/main/java/org/bitbiome/commands/QuizCommand.java index 59d215f..976225d 100644 --- a/src/main/java/org/bitbiome/commands/QuizCommand.java +++ b/src/main/java/org/bitbiome/commands/QuizCommand.java @@ -11,9 +11,9 @@ import java.util.Date; import java.util.Random; import java.util.Scanner; -public class QuizCommand implements CommandAPI { +public class QuizCommand { private Scanner quizScanner; - @Override + public void performCommand(Scanner scanner, boolean isRunning, String message, TravelEngine travelEngine) { quizScanner = new Scanner(System.in); @@ -78,7 +78,7 @@ public class QuizCommand implements CommandAPI { } public static int addGold() { - String playerpath = "src/main/resources/ssplayerconfig.json"; + String playerpath = "src/main/resources/playerconfig.json"; JSONObject playerconfig = JsonParser.getJSONObject(playerpath); int gold = playerconfig.getInt("gold"); gold = gold + 5; diff --git a/src/main/java/org/bitbiome/commands/ShopCommand.java b/src/main/java/org/bitbiome/commands/ShopCommand.java index 1beb579..b4d8fbd 100644 --- a/src/main/java/org/bitbiome/commands/ShopCommand.java +++ b/src/main/java/org/bitbiome/commands/ShopCommand.java @@ -1,5 +1,6 @@ package org.bitbiome.commands; +import org.bitbiome.classes.BlackJack; import org.bitbiome.classes.Colors; import org.bitbiome.classes.TravelEngine; import org.bitbiome.shop.Item; @@ -10,13 +11,16 @@ import java.util.Scanner; public class ShopCommand implements CommandAPI{ - Shop shop = new Shop(); + Shop shop; + BlackJack blackJack; public ShopCommand(){ } @Override public void performCommand(Scanner scanner, boolean isRunning, String message, TravelEngine travelEngine) { + shop = new Shop(scanner, isRunning, message, travelEngine); + blackJack = new BlackJack(travelEngine.getPlayer().getName()); System.out.println(Colors.ANSI_BG_YELLOW + Colors.ANSI_BLACK + "Willkommen im Shop!" + Colors.ANSI_RESET); ArrayList currentItems = shop.loadCurrentShopItems(); @@ -25,7 +29,8 @@ public class ShopCommand implements CommandAPI{ System.out.println("Was willst Du hier im Shop?"); System.out.println("Etwas kaufen: 1"); System.out.println("Das Quiz spielen: 2"); - System.out.println("Den Shop verlassen: 3"); + System.out.println("Blackjack spielen: 3"); + System.out.println("Den Shop verlassen: 4"); String input = scanner.nextLine(); if(validInput(input)){ @@ -60,8 +65,10 @@ public class ShopCommand implements CommandAPI{ } } } else if(input.equals("2")){ - //shop.quiz() + shop.quiz(); } else if(input.equals("3")){ + shop.blackJack(); + }else if(input.equals("4")){ System.out.println("Der Shop wurde verlassen!"); break; } @@ -72,7 +79,7 @@ public class ShopCommand implements CommandAPI{ } public static boolean validInput(String input){ - return (input.equals("1") || input.equals("2") || input.equals("3")); + return (input.equals("1") || input.equals("2") || input.equals("3") || input.equals("4")); } } diff --git a/src/main/java/org/bitbiome/shop/Shop.java b/src/main/java/org/bitbiome/shop/Shop.java index 9bcd1d9..fdc2228 100644 --- a/src/main/java/org/bitbiome/shop/Shop.java +++ b/src/main/java/org/bitbiome/shop/Shop.java @@ -2,6 +2,11 @@ package org.bitbiome.shop; import org.bitbiome.classes.Colors; import org.bitbiome.classes.JsonParser; +import org.bitbiome.classes.TravelEngine; +import org.bitbiome.commands.BlackJackCommand; +import org.bitbiome.commands.QuitCommand; +import org.bitbiome.commands.QuizCommand; +import org.bitbiome.commands.ShopCommand; import org.json.JSONArray; import org.json.JSONObject; @@ -12,13 +17,25 @@ import java.nio.file.Paths; import java.util.ArrayList; import java.util.HashSet; import java.util.Random; +import java.util.Scanner; public class Shop { public ArrayList allItems; public ArrayList currentShopItems; public JsonParser jsonParser = new JsonParser(); + public QuizCommand quizCommand = new QuizCommand(); + public BlackJackCommand blackJackCommand = new BlackJackCommand(); + public Scanner scanner; + public boolean isRunning; + public String message; + public TravelEngine travelEngine; + + public Shop(Scanner scanner, boolean isRunning, String message, TravelEngine travelEngin) { + this.scanner = scanner; + this.message = message; + this.isRunning = isRunning; + this.travelEngine = travelEngin; - public Shop() { try { allItems = loadAllItems(); currentShopItems = loadPartofItems(allItems, 3); @@ -216,9 +233,14 @@ public class Shop { } public void quiz(){ - //ToDo + quizCommand.performCommand(scanner, isRunning, message, travelEngine); } + public void blackJack(){ + System.out.println(""); + blackJackCommand.performCommand(scanner, isRunning, message, travelEngine); + System.out.println(""); + } private void printArrayList(ArrayList arrayList){ System.out.println(""); for(int i = 0; i < arrayList.size(); i++){ diff --git a/src/test/java/org/bitbiome/commands/ShopCommandTest.java b/src/test/java/org/bitbiome/commands/ShopCommandTest.java index d80674d..5dad043 100755 --- a/src/test/java/org/bitbiome/commands/ShopCommandTest.java +++ b/src/test/java/org/bitbiome/commands/ShopCommandTest.java @@ -7,7 +7,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; public class ShopCommandTest { final ShopCommand shopCommand = new ShopCommand(); - final Shop shop = new Shop(); + final Shop shop = new Shop(null, true, null, null); @Test public void testValidInput1(){ boolean expected = true; @@ -28,7 +28,7 @@ public class ShopCommandTest { } @Test public void testValidInput4(){ - boolean expected = false; + boolean expected = true; boolean result = shopCommand.validInput("4"); assertEquals(expected, result); } From 98e47536dbb0897356d9455eae767e61fa994736 Mon Sep 17 00:00:00 2001 From: David Hermann Date: Tue, 7 Feb 2023 18:04:19 +0100 Subject: [PATCH 136/152] refactoring: Edited unit test in non-act part Instance now static --- src/test/java/org/bitbiome/commands/ShopCommandTest.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/test/java/org/bitbiome/commands/ShopCommandTest.java b/src/test/java/org/bitbiome/commands/ShopCommandTest.java index 5dad043..5190e63 100755 --- a/src/test/java/org/bitbiome/commands/ShopCommandTest.java +++ b/src/test/java/org/bitbiome/commands/ShopCommandTest.java @@ -6,30 +6,29 @@ import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; public class ShopCommandTest { - final ShopCommand shopCommand = new ShopCommand(); final Shop shop = new Shop(null, true, null, null); @Test public void testValidInput1(){ boolean expected = true; - boolean result = shopCommand.validInput("1"); + boolean result = ShopCommand.validInput("1"); assertEquals(expected, result); } @Test public void testValidInput2(){ boolean expected = true; - boolean result = shopCommand.validInput("2"); + boolean result = ShopCommand.validInput("2"); assertEquals(expected, result); } @Test public void testValidInput3(){ boolean expected = true; - boolean result = shopCommand.validInput("3"); + boolean result = ShopCommand.validInput("3"); assertEquals(expected, result); } @Test public void testValidInput4(){ boolean expected = true; - boolean result = shopCommand.validInput("4"); + boolean result = ShopCommand.validInput("4"); assertEquals(expected, result); } From 21c3acc2606208129a23399e5794eeb291d640f0 Mon Sep 17 00:00:00 2001 From: David Hermann Date: Tue, 7 Feb 2023 18:05:56 +0100 Subject: [PATCH 137/152] refactoring: Deleted unused imports --- src/main/java/org/bitbiome/shop/Shop.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/main/java/org/bitbiome/shop/Shop.java b/src/main/java/org/bitbiome/shop/Shop.java index fdc2228..5013a22 100644 --- a/src/main/java/org/bitbiome/shop/Shop.java +++ b/src/main/java/org/bitbiome/shop/Shop.java @@ -4,14 +4,11 @@ import org.bitbiome.classes.Colors; import org.bitbiome.classes.JsonParser; import org.bitbiome.classes.TravelEngine; import org.bitbiome.commands.BlackJackCommand; -import org.bitbiome.commands.QuitCommand; import org.bitbiome.commands.QuizCommand; -import org.bitbiome.commands.ShopCommand; import org.json.JSONArray; import org.json.JSONObject; import java.io.File; -import java.io.FileWriter; import java.nio.file.Files; import java.nio.file.Paths; import java.util.ArrayList; From 4d9ec59d3fe30129085eb554a05b85ebbedb48a8 Mon Sep 17 00:00:00 2001 From: David Hermann Date: Tue, 7 Feb 2023 19:20:47 +0100 Subject: [PATCH 138/152] refactoring: code revision of shop Fixed all warnings Outsourced methods due to code duplication Moving classes to new folders Merging of item class --- .../org/bitbiome/classes/InteractionLoop.java | 1 - .../org/bitbiome/{shop => classes}/Shop.java | 173 ++++++++++-------- .../org/bitbiome/commands/ShopCommand.java | 10 +- src/main/java/org/bitbiome/entities/Item.java | 28 ++- src/main/java/org/bitbiome/shop/Item.java | 38 ---- .../bitbiome/commands/ShopCommandTest.java | 3 +- .../org/bitbiome/entitiesTest/ItemTest.java | 6 +- 7 files changed, 130 insertions(+), 129 deletions(-) rename src/main/java/org/bitbiome/{shop => classes}/Shop.java (56%) delete mode 100644 src/main/java/org/bitbiome/shop/Item.java diff --git a/src/main/java/org/bitbiome/classes/InteractionLoop.java b/src/main/java/org/bitbiome/classes/InteractionLoop.java index 062852b..ee504d6 100644 --- a/src/main/java/org/bitbiome/classes/InteractionLoop.java +++ b/src/main/java/org/bitbiome/classes/InteractionLoop.java @@ -1,7 +1,6 @@ package org.bitbiome.classes; import org.bitbiome.Boot; -import org.bitbiome.classes.*; import org.json.JSONObject; import java.util.Scanner; diff --git a/src/main/java/org/bitbiome/shop/Shop.java b/src/main/java/org/bitbiome/classes/Shop.java similarity index 56% rename from src/main/java/org/bitbiome/shop/Shop.java rename to src/main/java/org/bitbiome/classes/Shop.java index 5013a22..6358078 100644 --- a/src/main/java/org/bitbiome/shop/Shop.java +++ b/src/main/java/org/bitbiome/classes/Shop.java @@ -1,10 +1,8 @@ -package org.bitbiome.shop; +package org.bitbiome.classes; -import org.bitbiome.classes.Colors; -import org.bitbiome.classes.JsonParser; -import org.bitbiome.classes.TravelEngine; import org.bitbiome.commands.BlackJackCommand; import org.bitbiome.commands.QuizCommand; +import org.bitbiome.entities.Item; import org.json.JSONArray; import org.json.JSONObject; @@ -19,7 +17,6 @@ import java.util.Scanner; public class Shop { public ArrayList allItems; public ArrayList currentShopItems; - public JsonParser jsonParser = new JsonParser(); public QuizCommand quizCommand = new QuizCommand(); public BlackJackCommand blackJackCommand = new BlackJackCommand(); public Scanner scanner; @@ -36,19 +33,19 @@ public class Shop { try { allItems = loadAllItems(); currentShopItems = loadPartofItems(allItems, 3); - }catch (Exception e){ + } catch (Exception e) { e.printStackTrace(); } } - public boolean buy(String itemName, int amount){ - //Create File Objects + public boolean buy(String itemName, int amount) { + // Create File Objects currentShopItems = loadCurrentShopItems(); File filePlayerConfig = new File("src/main/resources/playerconfig.json"); File fileGameConfig = new File("src/main/resources/gameconfig.json"); File fileItem = new File("src/main/resources/items.json"); try { - //Create JSONObjects + // Create JSONObjects String content1 = new String(Files.readAllBytes(Paths.get(filePlayerConfig.toURI())), "UTF-8"); JSONObject playerConfig = new JSONObject(content1); @@ -58,37 +55,40 @@ public class Shop { String content3 = new String(Files.readAllBytes(Paths.get(fileItem.toURI())), "UTF-8"); JSONArray itemJSON = new JSONArray(content3); - //Test if item still available in the shop + // Test if item still available in the shop int itemIndex = -1; - for(int i = 0; i < currentShopItems.size(); i++){ - if(currentShopItems.get(i).getName().equals(itemName)){ + for (int i = 0; i < currentShopItems.size(); i++) { + if (currentShopItems.get(i).getName().equals(itemName)) { itemIndex = i; } } - if(itemIndex == -1){ - System.out.println(Colors.ANSI_BG_RED + Colors.ANSI_BLACK + "Dieses Item gibt es nicht!" + Colors.ANSI_RESET); + if (itemIndex == -1) { + System.out.println( + Colors.ANSI_BG_RED + Colors.ANSI_BLACK + "Dieses Item gibt es nicht!" + Colors.ANSI_RESET); return false; } - if(!(currentShopItems.get(itemIndex).amount > 0)){ - System.out.println(Colors.ANSI_BG_RED + Colors.ANSI_BLACK + "Es gibt zu wenige Items!" + Colors.ANSI_RESET); + if (!(currentShopItems.get(itemIndex).getAmount() > 0)) { + System.out.println( + Colors.ANSI_BG_RED + Colors.ANSI_BLACK + "Es gibt zu wenige Items!" + Colors.ANSI_RESET); return false; } - //Test if the player has enough gold - int costs = currentShopItems.get(itemIndex).gold * amount; + // Test if the player has enough gold + int costs = currentShopItems.get(itemIndex).getGold() * amount; int gold = (int) playerConfig.get("gold"); - if(!(gold >= costs)){ - System.out.println(Colors.ANSI_BG_RED + Colors.ANSI_BLACK + "Du hast zu wenig Gold!" + Colors.ANSI_RESET); + if (!(gold >= costs)) { + System.out + .println(Colors.ANSI_BG_RED + Colors.ANSI_BLACK + "Du hast zu wenig Gold!" + Colors.ANSI_RESET); return false; } - //Player gold subtract + // Player gold subtract playerConfig.put("gold", subtractGold(gold, costs)); - //Gameconfig amount reduese + // Gameconfig amount reduese JSONArray jsonArray2 = gameConfig.getJSONArray("shopitems"); int intNewAmount; - for(int i = 0; i < jsonArray2.length(); i++) { + for (int i = 0; i < jsonArray2.length(); i++) { JSONObject tempJSON = jsonArray2.getJSONObject(i); if (tempJSON.getString("name").equals(itemName)) { intNewAmount = tempJSON.getInt("amount") - amount; @@ -96,16 +96,16 @@ public class Shop { tempJSON.put("amount", intNewAmount); jsonArray2.put(tempJSON); gameConfig.put("shopitems", jsonArray2); - jsonParser.writeObject("gameconfig.json", gameConfig); + JsonParser.writeObject("src/main/resources/gameconfig.json", gameConfig); currentShopItems = loadCurrentShopItems(); break; } } - //Give Player the Item + // Give Player the Item JSONArray jsonArray = playerConfig.getJSONArray("inventory"); int newAmount; - for(int i = 0; i < jsonArray.length(); i++) { + for (int i = 0; i < jsonArray.length(); i++) { JSONObject tempJSON = jsonArray.getJSONObject(i); if (tempJSON.getString("name").equals(itemName)) { newAmount = tempJSON.getInt("amount") + amount; @@ -113,14 +113,14 @@ public class Shop { tempJSON.put("amount", newAmount); jsonArray.put(tempJSON); playerConfig.put("inventory", jsonArray); - jsonParser.writeObject("playerconfig.json", playerConfig); + JsonParser.writeObject("src/main/resources/playerconfig.json", playerConfig); return true; } } - //Item do not exist in the playerinventory + // Item do not exist in the playerinventory int durability = 0; - for(int i = 0; i < itemJSON.length(); i++) { + for (int i = 0; i < itemJSON.length(); i++) { JSONObject tempJSON = itemJSON.getJSONObject(i); if (tempJSON.getString("name").equals(itemName)) { durability = (int) tempJSON.get("durability"); @@ -134,121 +134,140 @@ public class Shop { jsonArray.put(inventory); playerConfig.put("inventory", jsonArray); - jsonParser.writeObject("playerconfig.json", playerConfig); + JsonParser.writeObject("src/main/resources/playerconfig.json", playerConfig); - }catch (Exception e){ + } catch (Exception e) { e.printStackTrace(); } return true; } - private ArrayList loadAllItems(){ + private ArrayList loadAllItems() { + ArrayList arrayList = new ArrayList<>(); + JSONArray itemJSON = returnJSONArrayOfAllItems(); + + arrayList = addToList(itemJSON, arrayList, "amountShop"); + return arrayList; + } + + public JSONArray returnJSONArrayOfAllItems() { File file = new File("src/main/resources/items.json"); - ArrayList arrayList = new ArrayList(); + JSONArray itemJSON = null; try { String content3 = new String(Files.readAllBytes(Paths.get(file.toURI())), "UTF-8"); - JSONArray itemJSON = new JSONArray(content3); - - for(int i = 0; i < itemJSON.length(); i++){ - JSONObject tempJSON = itemJSON.getJSONObject(i); - arrayList.add(new Item(tempJSON.getString("name"), tempJSON.getInt("amountShop"), tempJSON.getInt("gold"))); - } - }catch (Exception e){ + itemJSON = new JSONArray(content3); + } catch (Exception e) { e.printStackTrace(); } + return itemJSON; + } - return arrayList; + public ArrayList loadCurrentShopItems() { + + ArrayList arrayList = new ArrayList<>(); + JSONObject jsonObject = JsonParser.getJSONObject("src/main/resources/gameconfig.json"); + JSONArray jsonArray = jsonObject.getJSONArray("shopitems"); + + return addToList(jsonArray, arrayList, "amount"); } - public ArrayList loadCurrentShopItems(){ - File file = new File("src/main/resources/gameconfig.json"); - ArrayList arrayList = new ArrayList(); - try { - String content = new String(Files.readAllBytes(Paths.get(file.toURI())), "UTF-8"); - JSONObject jsonObject = new JSONObject(content); + public JSONObject getItemByName(String itemName, JSONArray itemArray) { + for (int i = 0; i < itemArray.length(); i++) { + if (itemArray.getJSONObject(i).getString("name").equals(itemName)) { + return itemArray.getJSONObject(i); + } + } + return null; + } - JSONArray jsonArray = jsonObject.getJSONArray("shopitems"); - for(int i = 0; i < jsonArray.length(); i++){ - JSONObject tempJSON = jsonArray.getJSONObject(i); - arrayList.add(new Item(tempJSON.getString("name"), tempJSON.getInt("amount"), tempJSON.getInt("gold"))); + public ArrayList addToList(JSONArray itemJSON, ArrayList arrayList, String key) { + JSONArray allItems = returnJSONArrayOfAllItems(); + for (int i = 0; i < itemJSON.length(); i++) { + JSONObject tempJSON = itemJSON.getJSONObject(i); + String damage; + boolean doesDmg; + if (key.equals("amount")) { + damage = getItemByName(tempJSON.getString("name"), allItems).getString("damage"); + } else { + damage = tempJSON.getString("damage"); } - }catch (Exception e){ - e.printStackTrace(); + doesDmg = !damage.equals("0") ? false : true; + arrayList.add(new Item(tempJSON.getString("name"), doesDmg, damage, tempJSON.getInt(key), + tempJSON.getInt("gold"))); } - return arrayList; } - private ArrayList loadPartofItems(ArrayList alleItems, int itemCount) { - ArrayList arrayList = new ArrayList(); - try{ + private ArrayList loadPartofItems(ArrayList alleItems, int itemCount) { + ArrayList arrayList = new ArrayList<>(); + try { File fileGameConfig = new File("src/main/resources/gameconfig.json"); String content2 = new String(Files.readAllBytes(Paths.get(fileGameConfig.toURI())), "UTF-8"); JSONObject gameConfig = new JSONObject(content2); - JSONArray jsonArray = gameConfig.getJSONArray("shopitems"); + //JSONArray jsonArray = gameConfig.getJSONArray("shopitems"); HashSet hashSet = new HashSet<>(); JSONArray shopitems = new JSONArray(); Random random = new Random(); - while (hashSet.size() < itemCount){ + while (hashSet.size() < itemCount) { int rand = random.nextInt(alleItems.size()); - if(!hashSet.contains(rand)){ + if (!hashSet.contains(rand)) { hashSet.add(rand); arrayList.add(alleItems.get(rand)); JSONObject jsonObject = new JSONObject(); - jsonObject.put("name", alleItems.get(rand).name); - jsonObject.put("amount", alleItems.get(rand).amount); - jsonObject.put("gold", alleItems.get(rand).gold); + jsonObject.put("name", alleItems.get(rand).getName()); + jsonObject.put("amount", alleItems.get(rand).getAmount()); + jsonObject.put("gold", alleItems.get(rand).getGold()); shopitems.put(jsonObject); } } - //write in gameconfig.json + // write in gameconfig.json gameConfig.remove("shopitems"); gameConfig.put("shopitems", shopitems); - jsonParser.writeObject("gameconfig.json", gameConfig); - + JsonParser.writeObject("src/main/resources/gameconfig.json", gameConfig); - }catch (Exception e){ + } catch (Exception e) { e.printStackTrace(); } - return arrayList; } public void itemRotation() { try { currentShopItems = loadPartofItems(allItems, 3); - }catch (Exception e){ + } catch (Exception e) { e.printStackTrace(); } } - public void printCurrentShopItems(){ + public void printCurrentShopItems() { printArrayList(currentShopItems); } - public void quiz(){ + public void quiz() { quizCommand.performCommand(scanner, isRunning, message, travelEngine); } - public void blackJack(){ + public void blackJack() { System.out.println(""); blackJackCommand.performCommand(scanner, isRunning, message, travelEngine); System.out.println(""); } - private void printArrayList(ArrayList arrayList){ + + private void printArrayList(ArrayList arrayList) { System.out.println(""); - for(int i = 0; i < arrayList.size(); i++){ - if(arrayList.get(i).getAmount() != 0) { - System.out.println(arrayList.get(i).getName() + " | Anzahl: " + arrayList.get(i).getAmount() + " | Kosten: " + arrayList.get(i).getGold()); + for (int i = 0; i < arrayList.size(); i++) { + if (arrayList.get(i).getAmount() != 0) { + System.out.println(arrayList.get(i).getName() + " | Anzahl: " + arrayList.get(i).getAmount() + + " | Kosten: " + arrayList.get(i).getGold()); } } System.out.println(""); } - public int subtractGold(int gold, int cost){ + public int subtractGold(int gold, int cost) { return gold - cost; } } diff --git a/src/main/java/org/bitbiome/commands/ShopCommand.java b/src/main/java/org/bitbiome/commands/ShopCommand.java index b4d8fbd..4de36ef 100644 --- a/src/main/java/org/bitbiome/commands/ShopCommand.java +++ b/src/main/java/org/bitbiome/commands/ShopCommand.java @@ -2,9 +2,9 @@ package org.bitbiome.commands; import org.bitbiome.classes.BlackJack; import org.bitbiome.classes.Colors; +import org.bitbiome.classes.Shop; import org.bitbiome.classes.TravelEngine; -import org.bitbiome.shop.Item; -import org.bitbiome.shop.Shop; +import org.bitbiome.entities.Item; import java.util.ArrayList; import java.util.Scanner; @@ -37,7 +37,7 @@ public class ShopCommand implements CommandAPI{ if(input.equals("1")){ System.out.println("Folgende Items sind im Shop: "); for(int i = 0; i < currentItems.size(); i++){ - System.out.println((i + 1) + ". " + currentItems.get(i).name + " | Anzahl: " + currentItems.get(i).amount + " | Gold: " + currentItems.get(i).gold); + System.out.println((i + 1) + ". " + currentItems.get(i).getName() + " | Anzahl: " + currentItems.get(i).getAmount() + " | Gold: " + currentItems.get(i).getGold()); } System.out.println("0 Eingeben um den Shop zu verlassen."); System.out.println(""); @@ -47,8 +47,8 @@ public class ShopCommand implements CommandAPI{ System.out.print("Anzahl eingeben: "); String amount = scanner.nextLine(); try { - if ((Integer.parseInt(amount) <= currentItems.get(Integer.parseInt(itemNumber) - 1).amount) && ((Integer.parseInt(amount) - 1) > -1)) { - boolean bool = shop.buy(currentItems.get(Integer.parseInt(itemNumber) - 1).name, Integer.parseInt(amount)); + if ((Integer.parseInt(amount) <= currentItems.get(Integer.parseInt(itemNumber) - 1).getAmount()) && ((Integer.parseInt(amount) - 1) > -1)) { + boolean bool = shop.buy(currentItems.get(Integer.parseInt(itemNumber) - 1).getName(), Integer.parseInt(amount)); currentItems = shop.loadCurrentShopItems(); if (bool) { System.out.println(""); diff --git a/src/main/java/org/bitbiome/entities/Item.java b/src/main/java/org/bitbiome/entities/Item.java index 0ded3ff..cb3f280 100644 --- a/src/main/java/org/bitbiome/entities/Item.java +++ b/src/main/java/org/bitbiome/entities/Item.java @@ -4,13 +4,17 @@ public class Item { private String name; private boolean doesDamage; - private float damage; + private String damage; + private int amount; + private int gold; - public Item(String name, boolean doesDamage, float damage) { + public Item(String name, boolean doesDamage, String damage, int amount, int gold) { this.name = name; this.doesDamage = doesDamage; this.damage = damage; + this.amount = amount; + this.gold = gold; } public Item() { @@ -21,10 +25,26 @@ public class Item { return name; } - public float getDamage() { + public int getAmount() { + return amount; + } + + public void setAmount(int amount) { + this.amount = amount; + } + + public String getDamage() { return damage; } + public int getGold() { + return gold; + } + + public void setGold(int gold){ + this.gold = gold; + } + public boolean doesDamage() { return doesDamage; } @@ -33,7 +53,7 @@ public class Item { this.name = name; } - public void setDamage(float damage) { + public void setDamage(String damage) { this.damage = damage; } diff --git a/src/main/java/org/bitbiome/shop/Item.java b/src/main/java/org/bitbiome/shop/Item.java deleted file mode 100644 index c6f9672..0000000 --- a/src/main/java/org/bitbiome/shop/Item.java +++ /dev/null @@ -1,38 +0,0 @@ -package org.bitbiome.shop; - -public class Item { - public String name; - public int amount; - public int gold; - - - public Item(String name, int amount, int gold){ - this.name = name; - this.amount = amount; - this.gold = gold; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public int getAmount() { - return amount; - } - - public void setAmount(int amount) { - this.amount = amount; - } - - public int getGold() { - return gold; - } - - public void setGold(int gold) { - this.gold = gold; - } -} \ No newline at end of file diff --git a/src/test/java/org/bitbiome/commands/ShopCommandTest.java b/src/test/java/org/bitbiome/commands/ShopCommandTest.java index 5190e63..69c3de6 100755 --- a/src/test/java/org/bitbiome/commands/ShopCommandTest.java +++ b/src/test/java/org/bitbiome/commands/ShopCommandTest.java @@ -1,10 +1,11 @@ package org.bitbiome.commands; -import org.bitbiome.shop.Shop; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; +import org.bitbiome.classes.Shop; + public class ShopCommandTest { final Shop shop = new Shop(null, true, null, null); @Test diff --git a/src/test/java/org/bitbiome/entitiesTest/ItemTest.java b/src/test/java/org/bitbiome/entitiesTest/ItemTest.java index 4214043..069c5a7 100644 --- a/src/test/java/org/bitbiome/entitiesTest/ItemTest.java +++ b/src/test/java/org/bitbiome/entitiesTest/ItemTest.java @@ -15,7 +15,7 @@ public class ItemTest { public static void setItem() { item = new Item(); item.setName("Unit"); - item.setDamage(12.5F); + item.setDamage("12,5"); item.changeDoesDamage(true); } @@ -26,13 +26,13 @@ public class ItemTest { @Test public void testGetDamage() { - assertEquals(12.5, item.getDamage()); + assertEquals("12,5", item.getDamage()); } @Test public void testDoesDamage() { boolean doesDamage = item.doesDamage(); - assumeTrue(item.getDamage() > 0); + assumeTrue(item.getDamage().equals("12,5")); assumeTrue(doesDamage); } } From 47cbcc474ef9d6ad2b6ab7a7edd8e1b17c678c39 Mon Sep 17 00:00:00 2001 From: David Hermann Date: Tue, 7 Feb 2023 19:34:20 +0100 Subject: [PATCH 139/152] unittest: Edited the test method of QuizCmd AssertEquals is now AssertTrue It's testing whether the text contains something now --- src/test/java/org/bitbiome/commands/QuizCommandTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/java/org/bitbiome/commands/QuizCommandTest.java b/src/test/java/org/bitbiome/commands/QuizCommandTest.java index 937b97d..a8e9f93 100644 --- a/src/test/java/org/bitbiome/commands/QuizCommandTest.java +++ b/src/test/java/org/bitbiome/commands/QuizCommandTest.java @@ -9,12 +9,12 @@ public class QuizCommandTest { @Test public void testStartMessage() { - assertEquals("Du hast das Quiz gestartet! Hinweis: Wähle deine Antwort, indem du die Zahl (1-4) eingibst. Ist deine Lösung richtig, erhälst du 5 Münzen. Viel Erfolg! \n", QuizCommand.starterMessage()); + assertTrue(QuizCommand.starterMessage().contains("Du hast das Quiz gestartet!")); } @Test public void testEndMessage() { - assertEquals("Das Quiz ist vorbei!", QuizCommand.endMessage()); + assertTrue(QuizCommand.endMessage().contains("Das Quiz ist vorbei!")); } @Test From 4eedb57f987d87046b5dcf904b1049c3b2561ee6 Mon Sep 17 00:00:00 2001 From: David Hermann Date: Tue, 7 Feb 2023 19:34:55 +0100 Subject: [PATCH 140/152] Added color to outputs Added color and changed the format of: - QuizCommand - ShopCommand --- src/main/java/org/bitbiome/commands/QuizCommand.java | 11 ++++++----- src/main/java/org/bitbiome/commands/ShopCommand.java | 6 +++--- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/main/java/org/bitbiome/commands/QuizCommand.java b/src/main/java/org/bitbiome/commands/QuizCommand.java index 976225d..6c470dc 100644 --- a/src/main/java/org/bitbiome/commands/QuizCommand.java +++ b/src/main/java/org/bitbiome/commands/QuizCommand.java @@ -1,6 +1,7 @@ package org.bitbiome.commands; +import org.bitbiome.classes.Colors; import org.bitbiome.classes.JsonParser; import org.json.JSONArray; import org.json.JSONObject; @@ -22,7 +23,7 @@ public class QuizCommand { long diffTime = canPlayAgain(quiz.getLong("lastPlayed")); if (diffTime > 0) { - print("Du darfst erst in " + diffTime / 1000 / 60 + " Minuten spielen."); + print(Colors.ANSI_BG_RED + "Du darfst erst in " + diffTime / 1000 / 60 + " Minuten spielen." + Colors.ANSI_RESET + "\n"); return; } @@ -42,9 +43,9 @@ public class QuizCommand { if (answerIsCorrect(eingabe, korrekteAntwort, antworten)) { int neuerStand = addGold(); - print("Richtig! Du hast 5 Münzen verdient.\nDein Münzstand beträgt: " + neuerStand); + print(Colors.ANSI_BG_GREEN + "Richtig! Du hast 5 Münzen verdient." + Colors.ANSI_RESET + Colors.ANSI_CYAN + "\nDein Münzstand beträgt: " + Colors.ANSI_RESET + Colors.ANSI_BLUE + neuerStand + Colors.ANSI_RESET); } else { - print("Leider falsch... Richtig ist: " + korrekteAntwort + "\n"); + print(Colors.ANSI_BG_RED + "Leider falsch... Richtig ist: " + korrekteAntwort + Colors.ANSI_RESET + "\n"); } print(endMessage()); @@ -94,12 +95,12 @@ public class QuizCommand { } public static String starterMessage(){ - return "Du hast das Quiz gestartet! Hinweis: Wähle deine Antwort, indem du die Zahl (1-4) eingibst. Ist deine Lösung richtig, erhälst du 5 Münzen. Viel Erfolg! \n"; + return Colors.ANSI_CYAN + "Du hast das Quiz gestartet! Hinweis: Wähle deine Antwort, indem du die Zahl (1-4) eingibst. Ist deine Lösung richtig, erhälst du 5 Münzen. Viel Erfolg!" + Colors.ANSI_RESET + " \n"; } public static String endMessage(){ - return "Das Quiz ist vorbei!"; + return Colors.ANSI_CYAN + "Das Quiz ist vorbei!" + Colors.ANSI_RESET; } } diff --git a/src/main/java/org/bitbiome/commands/ShopCommand.java b/src/main/java/org/bitbiome/commands/ShopCommand.java index 4de36ef..b83887f 100644 --- a/src/main/java/org/bitbiome/commands/ShopCommand.java +++ b/src/main/java/org/bitbiome/commands/ShopCommand.java @@ -27,10 +27,10 @@ public class ShopCommand implements CommandAPI{ //whileloop for userinputs in the shop while (true){ System.out.println("Was willst Du hier im Shop?"); - System.out.println("Etwas kaufen: 1"); + System.out.println(Colors.ANSI_CYAN + "Etwas kaufen: 1"); System.out.println("Das Quiz spielen: 2"); System.out.println("Blackjack spielen: 3"); - System.out.println("Den Shop verlassen: 4"); + System.out.println("Den Shop verlassen: 4" + Colors.ANSI_RESET); String input = scanner.nextLine(); if(validInput(input)){ @@ -69,7 +69,7 @@ public class ShopCommand implements CommandAPI{ } else if(input.equals("3")){ shop.blackJack(); }else if(input.equals("4")){ - System.out.println("Der Shop wurde verlassen!"); + System.out.println(Colors.ANSI_BG_YELLOW + "Der Shop wurde verlassen!" + Colors.ANSI_RESET); break; } }else { From d0513fa2d342347379e7b758bd309f65c11df18b Mon Sep 17 00:00:00 2001 From: David Hermann Date: Tue, 7 Feb 2023 19:38:08 +0100 Subject: [PATCH 141/152] Edited output for quitCommand -> --- src/main/java/org/bitbiome/commands/QuitCommand.java | 3 ++- src/test/java/org/bitbiome/commands/QuitCommandTest.java | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/bitbiome/commands/QuitCommand.java b/src/main/java/org/bitbiome/commands/QuitCommand.java index 258ab1a..b84f513 100644 --- a/src/main/java/org/bitbiome/commands/QuitCommand.java +++ b/src/main/java/org/bitbiome/commands/QuitCommand.java @@ -1,5 +1,6 @@ package org.bitbiome.commands; +import org.bitbiome.classes.Colors; import org.bitbiome.classes.TravelEngine; import java.util.Scanner; @@ -17,6 +18,6 @@ public class QuitCommand implements CommandAPI { } public static String getQuitMessage() { - return "You quitted!"; + return Colors.ANSI_BG_GREEN + "Du hast das Spiel beendet! Bis bald." + Colors.ANSI_RESET; } } diff --git a/src/test/java/org/bitbiome/commands/QuitCommandTest.java b/src/test/java/org/bitbiome/commands/QuitCommandTest.java index 67a368e..3dd4eaa 100755 --- a/src/test/java/org/bitbiome/commands/QuitCommandTest.java +++ b/src/test/java/org/bitbiome/commands/QuitCommandTest.java @@ -3,13 +3,14 @@ package org.bitbiome.commands; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; public class QuitCommandTest { @Test public void testQuitCommand() { - assertEquals("You quitted!", QuitCommand.getQuitMessage()); + assertTrue(QuitCommand.getQuitMessage().contains("Spiel beendet!")); } } From 00ed13acf068d76ee4c177f89dffbddd2fadd714 Mon Sep 17 00:00:00 2001 From: David Hermann Date: Tue, 7 Feb 2023 19:41:24 +0100 Subject: [PATCH 142/152] refactoring: Deleted unused imports From QuitCommandTest --- src/test/java/org/bitbiome/commands/QuitCommandTest.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/test/java/org/bitbiome/commands/QuitCommandTest.java b/src/test/java/org/bitbiome/commands/QuitCommandTest.java index 3dd4eaa..4c6d0ec 100755 --- a/src/test/java/org/bitbiome/commands/QuitCommandTest.java +++ b/src/test/java/org/bitbiome/commands/QuitCommandTest.java @@ -2,7 +2,6 @@ package org.bitbiome.commands; import org.junit.jupiter.api.Test; -import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; public class QuitCommandTest { From c83a4ae33814621c581da45da60b2682b8e2223f Mon Sep 17 00:00:00 2001 From: David Hermann Date: Tue, 7 Feb 2023 19:47:43 +0100 Subject: [PATCH 143/152] unittest: Added test to ItemTest This tests the amount of one item --- src/test/java/org/bitbiome/entitiesTest/ItemTest.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/test/java/org/bitbiome/entitiesTest/ItemTest.java b/src/test/java/org/bitbiome/entitiesTest/ItemTest.java index 069c5a7..1f1a677 100644 --- a/src/test/java/org/bitbiome/entitiesTest/ItemTest.java +++ b/src/test/java/org/bitbiome/entitiesTest/ItemTest.java @@ -17,6 +17,7 @@ public class ItemTest { item.setName("Unit"); item.setDamage("12,5"); item.changeDoesDamage(true); + item.setAmount(5); } @Test @@ -35,4 +36,9 @@ public class ItemTest { assumeTrue(item.getDamage().equals("12,5")); assumeTrue(doesDamage); } + + @Test + public void testGetAmount() { + assumeTrue(item.getAmount() == 5); + } } From 9ba0935868e6f8b5cffdc99d2821b821e648688e Mon Sep 17 00:00:00 2001 From: David Hermann Date: Tue, 7 Feb 2023 19:55:58 +0100 Subject: [PATCH 144/152] unittest: Added test to ItemTest This tests the price of the item --- src/test/java/org/bitbiome/entitiesTest/ItemTest.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/test/java/org/bitbiome/entitiesTest/ItemTest.java b/src/test/java/org/bitbiome/entitiesTest/ItemTest.java index 1f1a677..679cd08 100644 --- a/src/test/java/org/bitbiome/entitiesTest/ItemTest.java +++ b/src/test/java/org/bitbiome/entitiesTest/ItemTest.java @@ -18,6 +18,7 @@ public class ItemTest { item.setDamage("12,5"); item.changeDoesDamage(true); item.setAmount(5); + item.setGold(100); } @Test @@ -41,4 +42,9 @@ public class ItemTest { public void testGetAmount() { assumeTrue(item.getAmount() == 5); } + + @Test + public void testGetGold() { + assumeTrue(item.getGold() == 100); + } } From 87803bc281217ef73ea3b1ed740f25a383098cf0 Mon Sep 17 00:00:00 2001 From: Max Gerbeth Date: Wed, 8 Feb 2023 10:51:45 +0100 Subject: [PATCH 145/152] refactoring: Shop.java --- pom.xml | 2 +- src/main/java/org/bitbiome/classes/Shop.java | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index bd143b9..61152ec 100644 --- a/pom.xml +++ b/pom.xml @@ -28,7 +28,7 @@ org.json json - 20180130 + 20220320 diff --git a/src/main/java/org/bitbiome/classes/Shop.java b/src/main/java/org/bitbiome/classes/Shop.java index 6358078..f9d4561 100644 --- a/src/main/java/org/bitbiome/classes/Shop.java +++ b/src/main/java/org/bitbiome/classes/Shop.java @@ -7,6 +7,7 @@ import org.json.JSONArray; import org.json.JSONObject; import java.io.File; +import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Paths; import java.util.ArrayList; @@ -155,7 +156,7 @@ public class Shop { File file = new File("src/main/resources/items.json"); JSONArray itemJSON = null; try { - String content3 = new String(Files.readAllBytes(Paths.get(file.toURI())), "UTF-8"); + String content3 = new String(Files.readAllBytes(Paths.get(file.toURI())), StandardCharsets.UTF_8); itemJSON = new JSONArray(content3); } catch (Exception e) { e.printStackTrace(); @@ -192,7 +193,7 @@ public class Shop { } else { damage = tempJSON.getString("damage"); } - doesDmg = !damage.equals("0") ? false : true; + doesDmg = damage.equals("0"); arrayList.add(new Item(tempJSON.getString("name"), doesDmg, damage, tempJSON.getInt(key), tempJSON.getInt("gold"))); } From d9256f615491f436feb34c4a5b7f21cf15b0cd10 Mon Sep 17 00:00:00 2001 From: Max Gerbeth Date: Wed, 8 Feb 2023 10:55:47 +0100 Subject: [PATCH 146/152] added logo to README.md --- README.md | 2 +- src/main/resources/gameconfig.json | 98 ++++++++++++++---------------- 2 files changed, 46 insertions(+), 54 deletions(-) diff --git a/README.md b/README.md index f39622f..25cce03 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -*Hier Logo* + --- # BitBiome - TextAdventure ## What is the game about? diff --git a/src/main/resources/gameconfig.json b/src/main/resources/gameconfig.json index cb08775..f3021c1 100644 --- a/src/main/resources/gameconfig.json +++ b/src/main/resources/gameconfig.json @@ -1,55 +1,47 @@ { - "shopitems": [ - { - "name": "Holz", - "amount": 10, - "gold": 10 - }, - { - "name": "Heiliges Schwert der Engel", - "amount": 1, - "gold": 1000 - }, - { - "name": "Stein", - "amount": 5, - "gold": 100 - } - ], - "locations": [ - { - "name": "Wald", - "items": [ - "Holz", - "Stein" - ], - "mobs": [ - { - "name": "Big Foot", - "hp": 50, - "damage": "10-15", - "items": [ - "Fell" - ] - } - ] - }, - { - "name": "Strand", - "items": [ - "Holz", - "Stein" - ], - "mobs": [ - { - "name": "Big Foot", - "hp": 50, - "damage": "10-15", - "items": [ - "Fell" - ] - } - ] - } - ] + "shopitems": [ + { + "gold": 100, + "amount": 500, + "name": "Fell" + }, + { + "gold": 1000, + "amount": 1, + "name": "Heiliges Schwert der Engel" + }, + { + "gold": 2, + "amount": 1500, + "name": "Stein" + } + ], + "locations": [ + { + "mobs": [{ + "damage": "10-15", + "name": "Big Foot", + "hp": 50, + "items": ["Fell"] + }], + "name": "Wald", + "items": [ + "Holz", + "Stein" + ] + }, + { + "mobs": [{ + "damage": "10-15", + "name": "Big Foot", + "hp": 50, + "items": ["Fell"] + }], + "name": "Strand", + "items": [ + "Holz", + "Stein" + ] + } + ] } \ No newline at end of file From 091c1b5512718b561289c65feecd3aafc05746b5 Mon Sep 17 00:00:00 2001 From: Max Gerbeth Date: Wed, 8 Feb 2023 10:57:33 +0100 Subject: [PATCH 147/152] added logo --- src/main/resources/LogoBitbiome.png | Bin 0 -> 100311 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 src/main/resources/LogoBitbiome.png diff --git a/src/main/resources/LogoBitbiome.png b/src/main/resources/LogoBitbiome.png new file mode 100644 index 0000000000000000000000000000000000000000..581322bcc84dc5d1401487e42f99de26c719b488 GIT binary patch literal 100311 zcmeFX^;eZ&v^|V;ql8FHcXuNoUDAp)(%p@;AdQ4H(%lV*4yC){&>e?v-pBg^zxPjg zf4FBjhCGMCv)A5xt~uvgdxt0~NTMO*BSS$!p-D@LD?>pcz(PU6;3C2U-*D)yr~&`I za8Q;Mg(@8)+yNe79Ym#75rK~96F4M-u z)Jy-M`B238yUFmQ^QuA~)_km-I<*}kf5^C?$!6Kl@h!P@om_r9zSs)N?ua$75Tf}L z>)AQn&|mf6Zb4XYMHpZaF;QMjcr9ONLB+(#8IVH71RiY>=4+~5F1ah!tBtg)4Bw(a z1|ZnE4B{~q(*ONazNWGEOk8bLjDA-?RwMQAdwjFZ350=CTfBeY#7KzAd_{Zr^mj27 z1;t;YN*&Su*Y88{{Qf;D^RkI4{d=M_G)9#9_p~vL`oCTi_LG$6-%I1j*DAkXiTHx`^5MQ zx8*O(=Surz7xAUzP*yP zrSC5_K+gPhg_(tojxE3ND?8%6r=E%MOLhl9rqjjE!4poHb9>)Rb~9VjW^@n^&a*Gv zl|6`dED5sj?u2OLmM(_8UXwu@37G2d6BbjMu554%ZaH4+G`S$+?$2oK?j5xr*RS|p zt|+~gOM0JZPo)3HiDiSYvH%4swv1d(8&Rc{TrLUj<3>h0)e}LF@l0M`ZiUi+4x-Q& zCv&O+<^IMUo_N=bH1?BESyHf|>Sxqt)DY+OO|olQ(?gFKM$L~*E89am1lK#=#*Y;f z1N%HLsJX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++++ 1 file changed, 6 insertions(+) diff --git a/src/test/java/org/bitbiome/commands/ShopCommandTest.java b/src/test/java/org/bitbiome/commands/ShopCommandTest.java index 69c3de6..9c53114 100755 --- a/src/test/java/org/bitbiome/commands/ShopCommandTest.java +++ b/src/test/java/org/bitbiome/commands/ShopCommandTest.java @@ -84,4 +84,10 @@ public class ShopCommandTest { int result = shop.subtractGold(31, 16); assertEquals(expected, result); } + @Test + public void testSubtractGold8(){ + int expected = 1; + int result = shop.subtractGold(2, 1); + assertEquals(expected, result); + } } From d190f351358d3042b288a7f1a3e535dbe755938a Mon Sep 17 00:00:00 2001 From: Max Gerbeth Date: Wed, 8 Feb 2023 11:01:11 +0100 Subject: [PATCH 149/152] unittest: testSubtractGold9() --- src/test/java/org/bitbiome/commands/ShopCommandTest.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/test/java/org/bitbiome/commands/ShopCommandTest.java b/src/test/java/org/bitbiome/commands/ShopCommandTest.java index 9c53114..f650133 100755 --- a/src/test/java/org/bitbiome/commands/ShopCommandTest.java +++ b/src/test/java/org/bitbiome/commands/ShopCommandTest.java @@ -90,4 +90,10 @@ public class ShopCommandTest { int result = shop.subtractGold(2, 1); assertEquals(expected, result); } + @Test + public void testSubtractGold9(){ + int expected = 8; + int result = shop.subtractGold(10, 2); + assertEquals(expected, result); + } } From 1bac23ab982fd73b17913a883938e459789ef085 Mon Sep 17 00:00:00 2001 From: Max Gerbeth Date: Wed, 8 Feb 2023 11:20:49 +0100 Subject: [PATCH 150/152] reset playername to "null" --- src/main/resources/playerconfig.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/playerconfig.json b/src/main/resources/playerconfig.json index 9da94a1..8b09e23 100644 --- a/src/main/resources/playerconfig.json +++ b/src/main/resources/playerconfig.json @@ -1,6 +1,6 @@ { "gold": 0, - "name": "Dave", + "name": "null", "hp": 10, "inventory": [ { From b012bc345c3816927e8fb5e5979be0a3106195c9 Mon Sep 17 00:00:00 2001 From: Max Gerbeth Date: Wed, 8 Feb 2023 11:33:56 +0100 Subject: [PATCH 151/152] unittest: testSubtractGold10() --- src/test/java/org/bitbiome/commands/ShopCommandTest.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/test/java/org/bitbiome/commands/ShopCommandTest.java b/src/test/java/org/bitbiome/commands/ShopCommandTest.java index f650133..a0352c2 100755 --- a/src/test/java/org/bitbiome/commands/ShopCommandTest.java +++ b/src/test/java/org/bitbiome/commands/ShopCommandTest.java @@ -96,4 +96,10 @@ public class ShopCommandTest { int result = shop.subtractGold(10, 2); assertEquals(expected, result); } + @Test + public void testSubtractGold10(){ + int expected = 5; + int result = shop.subtractGold(10, 5); + assertEquals(expected, result); + } } From 433084fce95a1843e5726e1b69132e7094fe7d8e Mon Sep 17 00:00:00 2001 From: Max Gerbeth Date: Wed, 8 Feb 2023 11:36:50 +0100 Subject: [PATCH 152/152] refactoring: README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 25cce03..49fa6f4 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ - ---- +![BitBiome Logo](src/main/resources/LogoBitbiome.png) + # BitBiome - TextAdventure ## What is the game about? BitBiome is an exciting text adventure. Whether you want to travel through exciting biomes or measure with dangerous opponents. You can prove your knowledge in a quiz and buy new items in the shop as a reward.