From 73f8c055f24b94d6040c31828c8a567af3023e1f Mon Sep 17 00:00:00 2001 From: jendave Date: Tue, 30 Aug 2011 07:46:03 +0000 Subject: [PATCH] checkstyle fixes --- .../deck/generate/Generate5ColorDeck.java | 29 ++++++++++--------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/src/main/java/forge/deck/generate/Generate5ColorDeck.java b/src/main/java/forge/deck/generate/Generate5ColorDeck.java index b1ceac333df..3b90729f21d 100644 --- a/src/main/java/forge/deck/generate/Generate5ColorDeck.java +++ b/src/main/java/forge/deck/generate/Generate5ColorDeck.java @@ -84,7 +84,7 @@ public class Generate5ColorDeck { notColors.remove(color5); dl = GenerateDeckUtil.getDualLandList("WUBRG"); - + for (int i = 0; i < dl.size(); i++) { cardCounts.put(dl.get(i), 0); } @@ -93,10 +93,11 @@ public class Generate5ColorDeck { /** *

get3ColorDeck.

* - * @param Size a int. + * @param size a int. + * @param pt a PlayerType * @return a {@link forge.CardList} object. */ - public CardList get5ColorDeck(int Size, final PlayerType pt) { + public final CardList get5ColorDeck(final int size, final PlayerType pt) { int lc = 0; // loop counter to prevent infinite card selection loops String tmpDeck = ""; CardList tDeck = new CardList(); @@ -240,11 +241,11 @@ public class Generate5ColorDeck { // calculate card counts float p = (float) ((float) creatPercentage * .01); - int creatCnt = (int) (p * (float) Size); + int creatCnt = (int) (p * (float) size); tmpDeck += "Creature Count:" + creatCnt + "\n"; p = (float) ((float) spellPercentage * .01); - int spellCnt = (int) (p * (float) Size); + int spellCnt = (int) (p * (float) size); tmpDeck += "Spell Count:" + spellCnt + "\n"; // build deck from the card pools @@ -288,9 +289,9 @@ public class Generate5ColorDeck { int numLands = 0; if (landsPercentage > 0) { p = (float) ((float) landsPercentage * .01); - numLands = (int) (p * (float) Size); + numLands = (int) (p * (float) size); } else { // otherwise, just fill in the rest of the deck with basic lands - numLands = Size - tDeck.size(); + numLands = size - tDeck.size(); } tmpDeck += "numLands:" + numLands + "\n"; @@ -378,18 +379,18 @@ public class Generate5ColorDeck { tmpDeck += "DeckSize:" + tDeck.size() + "\n"; // fix under-sized or over-sized decks, due to integer arithmetic - if (tDeck.size() < Size) { - int diff = Size - tDeck.size(); + if (tDeck.size() < size) { + int diff = size - tDeck.size(); for (int i = 0; i < diff; i++) { Card c = tDeck.get(r.nextInt(tDeck.size())); lc = 0; - while (cardCounts.get(c.getName()) > 3 || lc > Size) { + while (cardCounts.get(c.getName()) > 3 || lc > size) { c = tDeck.get(r.nextInt(tDeck.size())); lc++; } - if (lc > Size) { + if (lc > size) { throw new RuntimeException("Generate5ColorDeck : get5ColorDeck -- looped too much -- undersize"); } @@ -398,8 +399,8 @@ public class Generate5ColorDeck { cardCounts.put(c.getName(), n + 1); tmpDeck += "Added:" + c.getName() + "\n"; } - } else if (tDeck.size() > Size) { - int diff = tDeck.size() - Size; + } else if (tDeck.size() > size) { + int diff = tDeck.size() - size; for (int i = 0; i < diff; i++) { Card c = tDeck.get(r.nextInt(tDeck.size())); @@ -450,7 +451,7 @@ public class Generate5ColorDeck { * * @param color */ - public void setCount(int count) { + public void setCount(final int count) { this.count = count; } }