mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
Code cleanup
This commit is contained in:
@@ -130,29 +130,27 @@ public class PlayerControllerHuman extends PlayerController {
|
|||||||
|
|
||||||
List<PaperCard> newMain = null;
|
List<PaperCard> newMain = null;
|
||||||
|
|
||||||
if (sbSize == 0 && mainSize == deckMinSize) {
|
//Skip sideboard loop if there are no sideboarding opportunities
|
||||||
// Skip sideboard loop if there are no sideboarding opportunities
|
if (sbSize == 0 && mainSize == deckMinSize) { return null; }
|
||||||
return null;
|
|
||||||
}
|
// conformance should not be checked here
|
||||||
else {
|
boolean conform = FModel.getPreferences().getPrefBoolean(FPref.ENFORCE_DECK_LEGALITY);
|
||||||
// conformance should not be checked here
|
do {
|
||||||
boolean conform = FModel.getPreferences().getPrefBoolean(FPref.ENFORCE_DECK_LEGALITY);
|
if (newMain != null) {
|
||||||
do {
|
String errMsg;
|
||||||
if (newMain != null) {
|
if (newMain.size() < deckMinSize) {
|
||||||
String errMsg;
|
errMsg = String.format("Too few cards in your main deck (minimum %d), please make modifications to your deck again.", deckMinSize);
|
||||||
if (newMain.size() < deckMinSize) {
|
|
||||||
errMsg = String.format("Too few cards in your main deck (minimum %d), please make modifications to your deck again.", deckMinSize);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
errMsg = String.format("Too many cards in your sideboard (maximum %d), please make modifications to your deck again.", sbMax);
|
|
||||||
}
|
|
||||||
SOptionPane.showErrorDialog(errMsg, "Invalid Deck");
|
|
||||||
}
|
}
|
||||||
// Sideboard rules have changed for M14, just need to consider min maindeck and max sideboard sizes
|
else {
|
||||||
// No longer need 1:1 sideboarding in non-limited formats
|
errMsg = String.format("Too many cards in your sideboard (maximum %d), please make modifications to your deck again.", sbMax);
|
||||||
newMain = GuiBase.getInterface().sideboard(sideboard, main);
|
}
|
||||||
} while (conform && (newMain.size() < deckMinSize || combinedDeckSize - newMain.size() > sbMax));
|
SOptionPane.showErrorDialog(errMsg, "Invalid Deck");
|
||||||
}
|
}
|
||||||
|
// Sideboard rules have changed for M14, just need to consider min maindeck and max sideboard sizes
|
||||||
|
// No longer need 1:1 sideboarding in non-limited formats
|
||||||
|
newMain = GuiBase.getInterface().sideboard(sideboard, main);
|
||||||
|
} while (conform && (newMain.size() < deckMinSize || combinedDeckSize - newMain.size() > sbMax));
|
||||||
|
|
||||||
return newMain;
|
return newMain;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user