diff --git a/Game.java b/Game.java index 020317a..ac4ee57 100644 --- a/Game.java +++ b/Game.java @@ -1,67 +1,87 @@ +import java.io.File; +import java.io.FileNotFoundException; +import java.io.IOException; import java.util.ArrayList; +import java.util.NoSuchElementException; import java.util.Scanner; public class Game { - public String name; - public static int minBet, maxBet; - public static int transactionNumber; - public static int houseMoney; + public String name; + public static int minBet, maxBet; - public static ArrayList playersInGame = new ArrayList(); + public static int transactionNumber; - public static ArrayList transactionLines = new ArrayList(); + public static int houseMoney; - public Game( String name, int minBet, int maxBet) { + public ArrayList playersInGame = new ArrayList(); - this.name = "100A" + name; - this.minBet = minBet; - this.maxBet = maxBet; + public ArrayList transactionLines = new ArrayList(); - transactionNumber = 0; + public Game(String name, int minBet, int maxBet) { - } + this.name = "100A" + name; + this.minBet = minBet; - public static void addPlayerFromQueue() { - //take player out of queue and put into playersInGame + this.maxBet = maxBet; - if(Mainpp.waitingPlayers.peek() == null) { - System.out.println("No waiting players to pull from Queue"); - } - else { - playersInGame.add(Mainpp.waitingPlayers.poll()); // adding to arrayList playersInGame from Queue waitingPlayers - } + transactionNumber = 0; - } + } - public static boolean hasSpace() { + public void addPlayerFromQueue() { + - if(playersInGame.size() < 5) { - return true; - } - else { - return false; - } - } - - public void addPlayer(Player p) { - playersInGame.add(p); - } + // take player out of queue and put into playersInGame - public static void printPlayers() { - for (int i = 0; i < playersInGame.size(); i++) { - System.out.println("Player " + playersInGame.get(i).name + " \t Money: $" + playersInGame.get(i).money); - } + if (Implementation.waitingPlayers.peek() == null) { - } + System.out.println("No waiting players to pull from Queue"); + + } + + + else { + + playersInGame.add(Implementation.waitingPlayers.poll()); // adding to arrayList playersInGame from Queue + // waitingPlayers + + } + + } + + public boolean hasSpace() { + + if (playersInGame.size() < 5) { + + return true; + + } + + else { + + return false; + + } + + } + + + public void printPlayers() { + + for (int i = 0; i < playersInGame.size(); i++) { + + System.out.println("Player " + playersInGame.get(i).name + " \t Money: $" + playersInGame.get(i).money); + + } + + } + + + + - public boolean playAgain(Scanner scan) { - String answer; - System.out.print("Play again [y/n]? "); - answer=scan.next(); - return answer.equalsIgnoreCase("y"); - } }