|
@ -1,5 +1,6 @@ |
|
|
package org.bitbiome.commands; |
|
|
package org.bitbiome.commands; |
|
|
|
|
|
|
|
|
|
|
|
import org.bitbiome.classes.BlackJack; |
|
|
import org.bitbiome.classes.Colors; |
|
|
import org.bitbiome.classes.Colors; |
|
|
import org.bitbiome.classes.TravelEngine; |
|
|
import org.bitbiome.classes.TravelEngine; |
|
|
import org.bitbiome.shop.Item; |
|
|
import org.bitbiome.shop.Item; |
|
@ -10,13 +11,16 @@ import java.util.Scanner; |
|
|
|
|
|
|
|
|
public class ShopCommand implements CommandAPI{ |
|
|
public class ShopCommand implements CommandAPI{ |
|
|
|
|
|
|
|
|
Shop shop = new Shop(); |
|
|
|
|
|
|
|
|
Shop shop; |
|
|
|
|
|
BlackJack blackJack; |
|
|
public ShopCommand(){ |
|
|
public ShopCommand(){ |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public void performCommand(Scanner scanner, boolean isRunning, String message, TravelEngine travelEngine) { |
|
|
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); |
|
|
System.out.println(Colors.ANSI_BG_YELLOW + Colors.ANSI_BLACK + "Willkommen im Shop!" + Colors.ANSI_RESET); |
|
|
ArrayList<Item> currentItems = shop.loadCurrentShopItems(); |
|
|
ArrayList<Item> currentItems = shop.loadCurrentShopItems(); |
|
|
|
|
|
|
|
@ -25,7 +29,8 @@ public class ShopCommand implements CommandAPI{ |
|
|
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"); |
|
|
System.out.println("Das Quiz spielen: 2"); |
|
|
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(); |
|
|
String input = scanner.nextLine(); |
|
|
if(validInput(input)){ |
|
|
if(validInput(input)){ |
|
@ -60,8 +65,10 @@ public class ShopCommand implements CommandAPI{ |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} else if(input.equals("2")){ |
|
|
} else if(input.equals("2")){ |
|
|
//shop.quiz() |
|
|
|
|
|
|
|
|
shop.quiz(); |
|
|
} else if(input.equals("3")){ |
|
|
} else if(input.equals("3")){ |
|
|
|
|
|
shop.blackJack(); |
|
|
|
|
|
}else if(input.equals("4")){ |
|
|
System.out.println("Der Shop wurde verlassen!"); |
|
|
System.out.println("Der Shop wurde verlassen!"); |
|
|
break; |
|
|
break; |
|
|
} |
|
|
} |
|
@ -72,7 +79,7 @@ public class ShopCommand implements CommandAPI{ |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public static boolean validInput(String input){ |
|
|
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")); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |