- Fixed the sideboarding code not allowing a deck with more cards than the original deck in Limited (Sealed, Draft) modes.

This commit is contained in:
Agetian
2013-03-10 18:34:27 +00:00
parent 8afd761a42
commit 187f700c2c
2 changed files with 4 additions and 3 deletions

View File

@@ -145,7 +145,8 @@ public class PlayerControllerHuman extends PlayerController {
JOptionPane.showMessageDialog(null, errMsg, "Invalid deck", JOptionPane.ERROR_MESSAGE);
}
newMain = GuiChoose.sideboard(sideboard.toFlatList(), main.toFlatList());
boolean isLimited = (gameType == GameType.Draft || gameType == GameType.Sealed);
newMain = GuiChoose.sideboard(sideboard.toFlatList(), main.toFlatList(), isLimited);
}
newSb.clear();

View File

@@ -149,10 +149,10 @@ public class GuiChoose {
return order(title, top, remainingObjects, sourceChoices, destChoices, referenceCard, false);
}
public static <T extends Comparable<? super T>> List<T> sideboard(List<T> sideboard, List<T> deck) {
public static <T extends Comparable<? super T>> List<T> sideboard(List<T> sideboard, List<T> deck, boolean isLimitedMode) {
Collections.sort(deck);
Collections.sort(sideboard);
return order("Sideboard", "Main Deck", sideboard.size(), sideboard, deck, null, true);
return order("Sideboard", "Main Deck", isLimitedMode ? -1 : sideboard.size(), sideboard, deck, null, true);
}