simplification

This commit is contained in:
okx-code
2019-03-21 21:57:49 +00:00
parent 7bfd407c58
commit 6e236109a7
18 changed files with 161 additions and 101 deletions
@@ -11,12 +11,12 @@ public class Prestiges extends RankList<Prestige> {
}
@Override
public Prestige getByPlayer(Player player) {
Prestige prestige = super.getByPlayer(player);
if (prestige == null) {
return getFirst();
} else {
return prestige;
public Prestige getFirst() {
for (Prestige prestige : ranks) {
if (prestige.getRank() == null) {
return prestige;
}
}
throw new IllegalStateException("No prestige found for first prestige (first prestige is counted as a prestige without a rank set)");
}
}