Пример #1
0
 public void pickAttackerOrder(UUID playerId, Game game) {
   if (attackers.isEmpty()) {
     return;
   }
   Player player = game.getPlayer(playerId);
   List<UUID> attackerList = new ArrayList<>(attackers);
   attackerOrder.clear();
   while (true) {
     if (attackerList.size() == 1) {
       attackerOrder.add(attackerList.get(0));
       break;
     } else {
       List<Permanent> attackerPerms = new ArrayList<>();
       for (UUID attackerId : attackerList) {
         attackerPerms.add(game.getPermanent(attackerId));
       }
       UUID attackerId = player.chooseAttackerOrder(attackerPerms, game);
       attackerOrder.add(attackerId);
       attackerList.remove(attackerId);
     }
   }
 }