if(!_playerTeam.contains(primarySummoner))
swapTeams();
_playerChampionSelections = new HashMap<String, LeagueChampion>();
for(Object o : obj.getArray("playerChampionSelections")) {
TypedObject to = (TypedObject)o;
_playerChampionSelections.put(to.getString("summonerInternalName"),
LeagueChampion.getChampionWithId(to.getInt("championId")));
}
_bannedChampions = new HashMap<TeamType, List<LeagueChampion>>();
for(TeamType t : TeamType.values()) {
_bannedChampions.put(t, new ArrayList<LeagueChampion>());
}
Object[] sortedBans = obj.getArray("bannedChampions");
Arrays.sort(sortedBans, new Comparator<Object>() {
public int compare(Object o1, Object o2) {
TypedObject to1 = (TypedObject)o1;
TypedObject to2 = (TypedObject)o2;
return to1.getInt("pickTurn").compareTo(to2.getInt("pickTurn"));
}
});
for(Object o : sortedBans) {
TypedObject to = (TypedObject)o;
TeamType teamType = TeamType.getFromId(to.getInt("teamId"));
LeagueChampion champion = LeagueChampion.getChampionWithId(to.getInt("championId"));
_bannedChampions.get(teamType).add(champion);
}
}