Code cleanup

This commit is contained in:
drdev
2014-09-01 01:51:38 +00:00
parent 034f56d331
commit 1e901cb59a
3 changed files with 17 additions and 17 deletions

View File

@@ -41,8 +41,8 @@ public enum DeckFormat {
Limited ( Range.between(40, Integer.MAX_VALUE), null, Integer.MAX_VALUE), Limited ( Range.between(40, Integer.MAX_VALUE), null, Integer.MAX_VALUE),
Commander ( Range.is(99), Range.between(0, 10), 1), Commander ( Range.is(99), Range.between(0, 10), 1),
Vanguard ( Range.between(60, Integer.MAX_VALUE), Range.is(0), 4), Vanguard ( Range.between(60, Integer.MAX_VALUE), Range.is(0), 4),
Planechase ( Range.between(60, Integer.MAX_VALUE), Range.is(0), 4),
MomirBasic ( Range.is(60), Range.is(0), Integer.MAX_VALUE), MomirBasic ( Range.is(60), Range.is(0), Integer.MAX_VALUE),
Planechase ( Range.between(60, Integer.MAX_VALUE), Range.is(0), 4),
Archenemy ( Range.between(60, Integer.MAX_VALUE), Range.is(0), 4); Archenemy ( Range.between(60, Integer.MAX_VALUE), Range.is(0), 4);
private final Range<Integer> mainRange; private final Range<Integer> mainRange;

View File

@@ -17,23 +17,21 @@ public enum GameType {
QuestDraft (DeckFormat.Limited, true, true, true, "Quest Draft"), QuestDraft (DeckFormat.Limited, true, true, true, "Quest Draft"),
Constructed (DeckFormat.Constructed, false, true, true, "Constructed"), Constructed (DeckFormat.Constructed, false, true, true, "Constructed"),
Vanguard (DeckFormat.Vanguard, true, true, true, "Vanguard"), Vanguard (DeckFormat.Vanguard, true, true, true, "Vanguard"),
MomirBasic (DeckFormat.MomirBasic, false, false, false, "Momir Basic"),
Commander (DeckFormat.Commander, false, false, false, "Commander"), Commander (DeckFormat.Commander, false, false, false, "Commander"),
Planechase (DeckFormat.Planechase, false, false, true, "Planechase"), Planechase (DeckFormat.Planechase, false, false, true, "Planechase"),
MomirBasic (DeckFormat.MomirBasic, false, false, false, "Momir Basic"),
Archenemy (DeckFormat.Archenemy, false, false, true, "Archenemy"), Archenemy (DeckFormat.Archenemy, false, false, true, "Archenemy"),
ArchenemyRumble (DeckFormat.Archenemy, false, false, true, "Archenemy Rumble"); ArchenemyRumble (DeckFormat.Archenemy, false, false, true, "Archenemy Rumble");
private final DeckFormat decksFormat; private final DeckFormat deckFormat;
private final boolean bCardpoolLimited; private final boolean isCardPoolLimited, canSideboard, addWonCardsMidGame;
private final boolean canSideboard;
private final boolean addWonCardsMidgame;
private final String name; private final String name;
GameType(DeckFormat formatType, boolean isDeckBuilderLimited, boolean sideboardingAllowed, boolean addAnteMidGame, String name0) { GameType(DeckFormat deckFormat0, boolean isCardPoolLimited0, boolean canSideboard0, boolean addWonCardsMidgame0, String name0) {
bCardpoolLimited = isDeckBuilderLimited; deckFormat = deckFormat0;
decksFormat = formatType; isCardPoolLimited = isCardPoolLimited0;
canSideboard = sideboardingAllowed; canSideboard = canSideboard0;
addWonCardsMidgame = addAnteMidGame; addWonCardsMidGame = addWonCardsMidgame0;
name = name0; name = name0;
} }
@@ -41,14 +39,14 @@ public enum GameType {
* @return the decksFormat * @return the decksFormat
*/ */
public DeckFormat getDecksFormat() { public DeckFormat getDecksFormat() {
return decksFormat; return deckFormat;
} }
/** /**
* @return the isCardpoolLimited * @return the isCardpoolLimited
*/ */
public boolean isCardpoolLimited() { public boolean isCardPoolLimited() {
return bCardpoolLimited; return isCardPoolLimited;
} }
/** /**
@@ -58,7 +56,9 @@ public enum GameType {
return canSideboard; return canSideboard;
} }
public boolean canAddWonCardsMidgame() { return addWonCardsMidgame; } public boolean canAddWonCardsMidGame() {
return addWonCardsMidGame;
}
public boolean isCommandZoneNeeded() { public boolean isCommandZoneNeeded() {
return true; //TODO: Figure out way to move command zone into field so it can be hidden when empty return true; //TODO: Figure out way to move command zone into field so it can be hidden when empty

View File

@@ -262,7 +262,7 @@ public class Match {
} }
} }
if (!rAICards.isEmpty() && !rules.getGameType().isCardpoolLimited()) { if (!rAICards.isEmpty() && !rules.getGameType().isCardPoolLimited()) {
game.getAction().revealAnte("AI can't play these cards well", rAICards); game.getAction().revealAnte("AI can't play these cards well", rAICards);
} }
@@ -348,7 +348,7 @@ public class Match {
outcome.anteResult.put(fromGame, GameOutcome.AnteResult.won(losses)); outcome.anteResult.put(fromGame, GameOutcome.AnteResult.won(losses));
} }
if (rules.getGameType().canAddWonCardsMidgame()) { if (rules.getGameType().canAddWonCardsMidGame()) {
// But only certain game types lets you swap midgame // But only certain game types lets you swap midgame
List<PaperCard> chosen = fromGame.getController().chooseCardsYouWonToAddToDeck(losses); List<PaperCard> chosen = fromGame.getController().chooseCardsYouWonToAddToDeck(losses);
if (null != chosen) { if (null != chosen) {