From b6f1b1f6d00584a4cb379ee9ad2462209e3cb1b1 Mon Sep 17 00:00:00 2001 From: Max Gerbeth Date: Wed, 11 Jan 2023 10:16:32 +0100 Subject: [PATCH] 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();