Minor code tidying in Escritoire

This commit is contained in:
mezz committed 2015-06-13 16:43:44 -07:00
1 parent 4851a70893
commit c90ea75fde
2 files changed
+14 -9

No files matched your search

@@ -224,7 +224,11 @@ public class NaturalistGame implements INBTTagable, IStreamable {
if (boardSize % 2 != 0) {
boardSize = Math.round((float) boardSize / 2) * 2;
}
boardSize = boardSize <= 22 ? boardSize >= 6 ? boardSize : 6 : 22;
if (boardSize > 22) {
boardSize = 22;
} else if (boardSize < 6) {
boardSize = 6;
}
isEnded = false;
bountyLevel = BOUNTY_MAX;
@@ -446,10 +450,7 @@ public class NaturalistGame implements INBTTagable, IStreamable {
ArrayList<GameToken> singles = new ArrayList<GameToken>();
for (GameToken token : gameTokens) {
if (!token.isRevealed) {
continue;
}
if (token == exclude) {
if (!token.isRevealed || token == exclude) {
continue;
}
@@ -479,10 +480,14 @@ public class NaturalistGame implements INBTTagable, IStreamable {
}
int samples = gameTokens.length / 4;
return samples >= 2 ? samples : 2;
return Math.max(samples, 2);
}
public GameToken getToken(int index) {
return gameTokens != null ? index < gameTokens.length ? gameTokens[index] : null : null;
if (gameTokens != null && index < gameTokens.length) {
return gameTokens[index];
}
return null;
}
}
@@ -37,7 +37,7 @@ import forestry.core.utils.StringUtil;
public class GuiEscritoire extends GuiForestry<ContainerEscritoire, TileEscritoire> {
private static enum Notes {
private enum Notes {
level1, level2, level3, level4, success, failure
}
@@ -48,7 +48,7 @@ public class GuiEscritoire extends GuiForestry<ContainerEscritoire, TileEscritoi
for (Notes notesLevel : Notes.values()) {
int levelCount = Integer.valueOf(StringUtil.localize("gui.escritoire.notes." + notesLevel + ".count"));
for (int i = 1; i <= levelCount; i++) {
String note = StringUtil.localize("gui.escritoire.notes." + notesLevel + "." + i);
String note = StringUtil.localize("gui.escritoire.notes." + notesLevel + '.' + i);
researchNotes.put(notesLevel, note);
}
}