diff --git a/Project/GameManager.java b/Project/GameManager.java new file mode 100644 index 0000000..0abb1df --- /dev/null +++ b/Project/GameManager.java @@ -0,0 +1,54 @@ +import java.util.ArrayList; +import java.util.Scanner; + +public class GameManager{ + private DiceCup diceCup; + + public GameManager (int num){ + diceCup = new DiceCup(num); + } + + public String toString(){ + ArrayList dice = diceCup.getDice(); + return "GameManager{\n" + + "Die 1 = " + dice.get(0).getValue() + + "\nDie 2 = " + dice.get(1).getValue() + + "Die 3 = " + dice.get(2).getValue() + "}\n"; + } + + public DiceCup getDice(){ + return diceCup; + } + + public static void main(String[] args){ + + Scanner scnr = new Scanner(System.in); + int diceSides; + + System.out.println("Do you want to play with 6 or 8 dice?\n"); + diceSides = scnr.nextInt(); + GameManager game = new GameManager(diceSides); + + String userInput; + + while (true){ + System.out.println("Type Roll to play, Stop to end\n"); + userInput = scnr.next(); + + if (userInput.toLowerCase() == "stop"){ + break;} + if (userInput.toLowerCase() == "roll"){ + System.out.println("Credits before bet: " + + game.diceCup.getCredits() + "\n"); + System.out.println(game.toString() + "\n"); + + + } + + } + + + scnr.close(); + } + +}