for (int i = 0; i < 5; i++) { for (int j = 2; j <= 12; j++) { for (Enumeration k = game.getPlayers(); k.hasMoreElements();) { final Player player = (Player)k.nextElement(); if (player.getInitiativeSize() > i && player.getInitiative(i) == j && isInitTie(j, i)) { player.setInitiative(Compute.d6(2), i + 1); } } } }
resolveInitTies(game.getPlayersVector());
    private void rollInitiative() {        roundCounter++;        // roll the dice for each player        for (Enumeration i = game.getPlayers(); i.hasMoreElements();) {            final Player player = (Player)i.nextElement();            player.clearInitiative();            player.setInitiative(Compute.d6(2), 0);        }                // roll off initiative ties, up to 5 times        // TODO: infinite rerolls        for (int i = 0; i < 5; i++) {            for (int j = 2; j <= 12; j++) {                for (Enumeration k = game.getPlayers(); k.hasMoreElements();) {                    final Player player = (Player)k.nextElement();                    if (player.getInitiativeSize() > i && player.getInitiative(i) == j && isInitTie(j, i)) {                        player.setInitiative(Compute.d6(2), i + 1);                    }                }            }        }                transmitAllPlayerUpdates();    }