Guest User

Untitled

a guest
Jun 19th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.43 KB | None | 0 0
  1. } else {
  2.                 ArrayList<Integer> winners = groups.get(0);
  3.                 double territory = 0d;
  4.                 int userWithMostTerritory = winners.get(0);
  5.                 for (Integer user : winners) {
  6.                     double userTerritory = 0d;
  7.                     for (TerritoryEntry tmp : bd.getTerritoryEntry()) {
  8.                         if (tmp.getCombatRoundId() == lastRound.getId()
  9.                                 && tmp.getUserId() == user) {
  10.                             if (tmp.getTerritorySize() > userTerritory) {
  11.                                 userTerritory = tmp.getTerritorySize();
  12.                             }
  13.                         }
  14.                     }
  15.                     if (userTerritory > territory) {
  16.                         territory = userTerritory;
  17.                         userWithMostTerritory = user;
  18.                     }
  19.                 }
  20.                 if (debug) {
  21.                     DebugBuffer.addLine(DebugLevel.GROUNDCOMBAT, "User with most territory : " + userDAO.findById(userWithMostTerritory).getGameName());
  22.                    
  23.                 }
  24.                 if (userWithMostTerritory == 0) {
  25.                     DebugBuffer.addLine(DebugLevel.GROUNDCOMBAT, "UserId with most territory is 0");
  26.                    
  27.                 }
  28.                 movePlanetToPlayer(userWithMostTerritory, bd.getPlanetId(), bd.getPlayerPlanet(), bd.getGroundCombatId());
  29.             }
Add Comment
Please, Sign In to add comment