mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-11 16:26:22 +00:00
Simplify logic
This commit is contained in:
@@ -279,17 +279,15 @@ public class BoosterDraft implements IBoosterDraft {
|
||||
}
|
||||
|
||||
public static BoosterDraft createDraft(final LimitedPoolType draftType, final CardBlock block, final String[] boosters, Integer numPlayers) {
|
||||
// quest draft
|
||||
final BoosterDraft draft = new BoosterDraft(draftType);
|
||||
|
||||
String setCode = boosters[0];
|
||||
CardEdition edition = FModel.getMagicDb().getEditions().get(setCode);
|
||||
// If this is metaset, edtion will be null
|
||||
if (edition != null) {
|
||||
if (numPlayers != null) {
|
||||
draft.setPodSize(numPlayers);
|
||||
} else if (draft.getPodSize() != edition.getDraftOptions().getRecommendedPodSize()) {
|
||||
// Auto choosing recommended pod size. In the future we may want to allow user to choose
|
||||
// Auto choosing recommended pod size. If we've chosen the podsize it should be passed in via numPlayers
|
||||
int newPodSize = Objects.requireNonNullElseGet(numPlayers, () -> edition.getDraftOptions().getRecommendedPodSize());
|
||||
if (newPodSize != draft.getPodSize()) {
|
||||
draft.setPodSize(edition.getDraftOptions().getRecommendedPodSize());
|
||||
}
|
||||
draft.doublePickDuringDraft = edition.getDraftOptions().isDoublePick(draft.getPodSize());
|
||||
|
||||
Reference in New Issue
Block a user