- Planechase variant now launched from Constructed match setup screen.

- moved random deck checkboxes into deck panel. Only show them when a random deck type is selected. They are still global settings however.
- when player 1 name is changed in preferences, switching back to constructed setup screen will reflect the change
This commit is contained in:
moomarc
2014-01-24 19:06:31 +00:00
parent 2cdf7030f8
commit 4cab5da076
15 changed files with 395 additions and 700 deletions

View File

@@ -170,27 +170,6 @@ public enum DeckFormat {
break;
case Planechase: //Must contain at least 10 planes/phenomenons, but max 2 phenomenons. Singleton.
final CardPool planes = deck.get(DeckSection.Planes);
if (planes == null || planes.countAll() < 10) {
return "should have at least 10 planes";
}
int phenoms = 0;
for (Entry<PaperCard, Integer> cp : planes) {
if (cp.getKey().getRules().getType().typeContains(CardType.CoreType.Phenomenon)) {
phenoms++;
}
if (cp.getValue() > 1) {
return "must not contain multiple copies of any Plane or Phenomena";
}
}
if (phenoms > 2) {
return "must not contain more than 2 Phenomena";
}
break;
case Archenemy: //Must contain at least 20 schemes, max 2 of each.
final CardPool schemes = deck.get(DeckSection.Schemes);
if (schemes == null || schemes.countAll() < 20) {
@@ -242,4 +221,25 @@ public enum DeckFormat {
return null;
}
public String getPlaneSectionConformanceProblem(CardPool planes) {
//Must contain at least 10 planes/phenomenons, but max 2 phenomenons. Singleton.
if (planes == null || planes.countAll() < 10) {
return "should have at least 10 planes";
}
int phenoms = 0;
for (Entry<PaperCard, Integer> cp : planes) {
if (cp.getKey().getRules().getType().typeContains(CardType.CoreType.Phenomenon)) {
phenoms++;
}
if (cp.getValue() > 1) {
return "must not contain multiple copies of any Plane or Phenomena";
}
}
if (phenoms > 2) {
return "must not contain more than 2 Phenomena";
}
return null;
}
}