Guest User

Untitled

a guest
Dec 7th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. public String checkHighDeaths() {
  2. String result = "";
  3. MatchPlayer highDeath = null;
  4.  
  5. Iterator<MatchPlayer> i = m_players.iterator();
  6. while (i.hasNext()) {
  7. MatchPlayer temp = i.next();
  8. if (temp.getPlayerState() == MatchPlayer.IN_GAME) {
  9.  
  10. if (highDeath == null)
  11. highDeath = temp; // you need to set result = player&#039;s name so that you have it ready
  12.  
  13. if (temp.getDeaths() > highDeath.getDeaths()) {
  14. highDeath = temp;
  15. result = highDeath.getPlayerName();
  16. }
  17. if (temp.getDeaths() == highDeath.getDeaths()) {
  18. result += "/" + highDeath.getPlayerName();
  19. }
  20. }
  21. }
  22. return result + " - " + highDeath;
  23.  
  24. }
Add Comment
Please, Sign In to add comment