This commit is contained in:
Anthony Calosa
2023-04-26 14:02:03 +08:00
committed by GitHub
parent 94bef3cf1c
commit ee0f99e0ad

View File

@@ -1,6 +1,7 @@
package forge.deck; package forge.deck;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap;
import java.util.List; import java.util.List;
import com.google.common.base.Predicate; import com.google.common.base.Predicate;
@@ -27,9 +28,12 @@ public class CommanderDeckGenerator extends DeckProxy implements Comparable<Comm
if (isCardGen){ if (isCardGen){
uniqueCards = new ItemPool<>(PaperCard.class); uniqueCards = new ItemPool<>(PaperCard.class);
String matrixKey = (format.equals(DeckFormat.TinyLeaders) ? DeckFormat.Commander : format).toString(); //use Commander for Tiny Leaders String matrixKey = (format.equals(DeckFormat.TinyLeaders) ? DeckFormat.Commander : format).toString(); //use Commander for Tiny Leaders
Iterable<String> legendNames = CardRelationMatrixGenerator.cardPools.get(matrixKey).keySet(); HashMap matrixPool = CardRelationMatrixGenerator.cardPools.get(matrixKey);
for (String legendName : legendNames) { if (matrixPool != null) {
uniqueCards.add(FModel.getMagicDb().getCommonCards().getUniqueByName(legendName)); Iterable<String> legendNames = matrixPool.keySet();
for (String legendName : legendNames) {
uniqueCards.add(FModel.getMagicDb().getCommonCards().getUniqueByName(legendName));
}
} }
} }
else { else {