Browse Source

Added Method printArrayList()

remotes/origin/shop
Max Gerbeth 2 years ago
parent
commit
49bd7cb2c6
  1. 4
      src/main/java/org/bitbiome/commands/ShopCommand.java
  2. 10
      src/main/java/org/bitbiome/shop/Shop.java

4
src/main/java/org/bitbiome/commands/ShopCommand.java

@ -1,12 +1,14 @@
package org.bitbiome.commands; package org.bitbiome.commands;
import org.bitbiome.shop.Shop;
import java.util.Scanner; import java.util.Scanner;
public class ShopCommand implements CommandAPI{ public class ShopCommand implements CommandAPI{
@Override @Override
public void performCommand(Scanner scanner, boolean isRunning, String message) { public void performCommand(Scanner scanner, boolean isRunning, String message) {
System.out.println("Willkommen im Shop!");
new Shop();
} }

10
src/main/java/org/bitbiome/shop/Shop.java

@ -7,7 +7,7 @@ public class Shop {
public ArrayList<Item> currentShopItems; public ArrayList<Item> currentShopItems;
public Shop(){ public Shop(){
allItems = loadItems();
} }
public boolean buy(){ public boolean buy(){
@ -35,4 +35,12 @@ public class Shop {
public void quiz(){ public void quiz(){
//ToDo //ToDo
} }
private void printArrayList(ArrayList<Item> 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("");
}
} }
Loading…
Cancel
Save