/** * gives turns for buying to players * * @throws IOException exception */ private static void buyTurnIncre() throws IOException { if (playerOrder.isEmpty()) { for (Player p : Configurations.getPlayers()) { if (p.getMoney() > 300 && !p.isPassed()) { playerOrder.add(p); } } if (playerOrder.isEmpty()) { Configurations.setRound(Configurations.getRound() + 1); // Applying random event to player 1 during initial game start Configurations.getCurPlayer().setMessage(applyRandomEvent()); Configurations.getGameScreenController() .updateText(Configurations.getCurPlayer().getMessage()); Configurations.getLoopService().start(); movePhaseTurnIncre(); return; } } Configurations.setCurPlayer(playerOrder.remove()); if (Configurations.getCurPlayer().isPassed()) { buyTurnIncre(); } Configurations.getGameScreenController().updateText(); }
/** * increments turn * * @throws IOException exception */ public static void incrementTurn() throws IOException { if (Configurations.getRound() == 0) { buyTurnIncre(); } else { movePhaseTurnIncre(); } }