From 49bd7cb2c6f1771023a3f5aacff2fca58f65e299 Mon Sep 17 00:00:00 2001 From: Max Gerbeth Date: Mon, 9 Jan 2023 17:26:58 +0100 Subject: [PATCH] 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(""); + } }