Browse Source

add Comments in ShopCommand.java

remotes/origin/shop
Max Gerbeth 2 years ago
parent
commit
cdb9e0d1d9
  1. 7
      src/main/java/org/bitbiome/commands/ShopCommand.java

7
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.Item;
import org.bitbiome.shop.Shop; import org.bitbiome.shop.Shop;
import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Scanner; import java.util.Scanner;
@ -19,7 +18,7 @@ public class ShopCommand implements CommandAPI{
System.out.println("Willkommen im Shop!"); System.out.println("Willkommen im Shop!");
ArrayList<Item> currentItems = shop.loadCurrentShopItems(); ArrayList<Item> currentItems = shop.loadCurrentShopItems();
//whileloop for userinputs in the shop
while (true){ while (true){
System.out.println("Was willst Du hier im Shop?"); System.out.println("Was willst Du hier im Shop?");
System.out.println("Etwas kaufen: 1"); System.out.println("Etwas kaufen: 1");
@ -43,11 +42,15 @@ public class ShopCommand implements CommandAPI{
if((Integer.parseInt(amount) <= currentItems.get(Integer.parseInt(itemNumber) - 1).amount) && ((Integer.parseInt(amount) - 1) > -1)){ 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)); boolean bool = shop.buy(currentItems.get(Integer.parseInt(itemNumber) - 1).name, Integer.parseInt(amount));
currentItems = shop.loadCurrentShopItems(); currentItems = shop.loadCurrentShopItems();
if(bool){
System.out.println(""); System.out.println("");
System.out.println("Vielen Dank für Ihren Einkauf!"); System.out.println("Vielen Dank für Ihren Einkauf!");
}else{ }else{
System.out.println("Fehler"); System.out.println("Fehler");
} }
}else{
System.out.println("Fehler");
}
} }
} else if(input.equals("2")){ } else if(input.equals("2")){
//shop.quiz() //shop.quiz()

Loading…
Cancel
Save