Skip to content

Commit

Permalink
Update WarCommands.java
Browse files Browse the repository at this point in the history
  • Loading branch information
xdnw committed Aug 4, 2024
1 parent af81b0b commit 9305bc4
Showing 1 changed file with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2559,9 +2559,18 @@ public String WarDecSheetDate(@Me IMessageIO io, @Me GuildDB db, Set<DBNation> n
Map<Long, Integer> defActivity = defWarsByTime.getOrDefault(nation.getNation_id(), new Long2IntOpenHashMap());
Function<Long, String> formatFunc;
if (split_off_def) {
formatFunc = f -> offActivity.getOrDefault(f, 0) + "/" + defActivity.getOrDefault(f, 0);
formatFunc = f -> {
// offActivity.getOrDefault(f, 0) + "/" + defActivity.getOrDefault(f, 0);
int offAmt = offActivity.getOrDefault(f, 0);
int defAmt = defActivity.getOrDefault(f, 0);
if (offAmt == 0 && defAmt == 0) return "";
return offAmt + "/" + defAmt;
};
} else {
formatFunc = f -> (offActivity.getOrDefault(f, 0) + defActivity.getOrDefault(f, 0)) + "";
formatFunc = f -> {
int amt = (offActivity.getOrDefault(f, 0) + defActivity.getOrDefault(f, 0));
return amt == 0 ? "" : amt + "";
};
}
header.set(0, MarkupUtil.sheetUrl(nation.getNation(), nation.getUrl()));
header.set(1, MarkupUtil.sheetUrl(nation.getAllianceName(), nation.getAllianceUrl()));
Expand Down

0 comments on commit 9305bc4

Please sign in to comment.