Updated codes

This commit is contained in:
Anthony Calosa
2019-09-05 20:56:17 +08:00
parent 0f62a297c7
commit efbd2a08eb
18 changed files with 47 additions and 56 deletions

View File

@@ -294,11 +294,7 @@ public class QuestEventDraft implements IQuestEvent {
int value;
final String boosterName = FModel.getMagicDb().getEditions().get(boosterSet).getName() + " Booster Pack";
if (MAP_PRICES.containsKey(boosterName)) {
value = MAP_PRICES.get(boosterName);
} else {
value = 395;
}
value = MAP_PRICES.getOrDefault(boosterName, 395);
boosterPrices += value;
@@ -518,11 +514,7 @@ public class QuestEventDraft implements IQuestEvent {
final String boosterName = booster.getName();
if (MAP_PRICES.containsKey(boosterName)) {
value = MAP_PRICES.get(boosterName);
} else {
value = 395;
}
value = MAP_PRICES.getOrDefault(boosterName, 395);
return value;
@@ -949,11 +941,7 @@ public class QuestEventDraft implements IQuestEvent {
int value;
final String boosterName = FModel.getMagicDb().getEditions().get(boosterSet).getName() + " Booster Pack";
if (MAP_PRICES.containsKey(boosterName)) {
value = MAP_PRICES.get(boosterName);
} else {
value = 395;
}
value = MAP_PRICES.getOrDefault(boosterName, 395);
entryFee += value;

View File

@@ -89,6 +89,10 @@ public class QuestPetStorage {
*/
private void addToMap(final QuestPetController petCtrl) {
final int iSlot = petCtrl.getSlot();
/*
* Refactoring this to List<QuestPetController> list = this.petsBySlot.computeIfAbsent(Integer.valueOf(iSlot), k -> new ArrayList<QuestPetController>());
* will cause Android not to compile
* */
List<QuestPetController> list = this.petsBySlot.get(Integer.valueOf(iSlot));
if (null == list) {
list = new ArrayList<QuestPetController>();