From 26b22e5f40d9e51e4d2355b314bb5623c61f5d73 Mon Sep 17 00:00:00 2001 From: moomarc Date: Thu, 15 Nov 2012 18:51:47 +0000 Subject: [PATCH] - Checkstyle --- .../card/cardfactory/CardFactoryUtil.java | 61 +++++++++---------- 1 file changed, 30 insertions(+), 31 deletions(-) diff --git a/src/main/java/forge/card/cardfactory/CardFactoryUtil.java b/src/main/java/forge/card/cardfactory/CardFactoryUtil.java index ed25790f388..b8720f20db0 100644 --- a/src/main/java/forge/card/cardfactory/CardFactoryUtil.java +++ b/src/main/java/forge/card/cardfactory/CardFactoryUtil.java @@ -260,9 +260,8 @@ public class CardFactoryUtil { } final List bLand = CardLists.getType(land, sminBL); - - for( Card ut : Iterables.filter(bLand, CardPredicates.Presets.UNTAPPED) ) - { + + for (Card ut : Iterables.filter(bLand, CardPredicates.Presets.UNTAPPED)) { return ut; } @@ -295,7 +294,7 @@ public class CardFactoryUtil { } }); } - + // get biggest Enchantment return Aggregates.itemWithMax(all, CardPredicates.Accessors.fnGetCmc); } @@ -819,7 +818,7 @@ public class CardFactoryUtil { @Override public boolean canPlayAI() { - PhaseHandler phase = Singletons.getModel().getGame().getPhaseHandler(); + PhaseHandler phase = Singletons.getModel().getGame().getPhaseHandler(); if (phase.getPhase().isAfter(PhaseType.MAIN1) || !phase.isPlayerTurn(getActivatingPlayer())) { return false; } @@ -1709,7 +1708,7 @@ public class CardFactoryUtil { return m; } - + /** *

* Parse player targeted X variables. @@ -1732,11 +1731,11 @@ public class CardFactoryUtil { final String[] m = CardFactoryUtil.parseMath(l); int n = 0; - + if (s.startsWith("Amount")) { n = objects.size(); } - + return CardFactoryUtil.doXMath(n, m, source); } @@ -2591,7 +2590,7 @@ public class CardFactoryUtil { oh = true; } } - + if (sq[0].contains("InChosenYard")) { if (!oh) { if (c.getChosenPlayer() != null) { @@ -3066,7 +3065,7 @@ public class CardFactoryUtil { return true; } - + /** *

* getMostProminentColor. @@ -3107,17 +3106,17 @@ public class CardFactoryUtil { return maxColor; } - + public static List getColorByProminence(final List list) { - final HashMap counts = new HashMap(); - for(String color : Constant.Color.ONLY_COLORS) { + final HashMap counts = new HashMap(); + for (String color : Constant.Color.ONLY_COLORS) { counts.put(color, 0); } - for(Card c : list) { + for (Card c : list) { List colors = c.determineColor().toStringList(); - for(String col : colors) { + for (String col : colors) { if (counts.containsKey(col)) { - counts.put(col.toString(), counts.get(col.toString())+1); + counts.put(col.toString(), counts.get(col.toString()) + 1); } } } @@ -3128,7 +3127,7 @@ public class CardFactoryUtil { return counts.get(b) - counts.get(a); } }); - + return res; } @@ -3373,7 +3372,7 @@ public class CardFactoryUtil { for (Card tmp : lands) { int score = tmp.isTapped() ? 2 : 0; score += tmp.isBasicLand() ? 1 : 0; - if( score >= maxScore ) { + if (score >= maxScore) { worstLand = tmp; maxScore = score; } @@ -3718,14 +3717,14 @@ public class CardFactoryUtil { final String parse = card.getKeyword().get(n).toString(); final String[] k = parse.split(" "); final int manacost = Integer.parseInt(k[1]); - - final String actualTrigger = "Mode$ ChangesZone | Origin$ Battlefield | Destination$ Graveyard" + - "| OptionalDecider$ You | ValidCard$ Card.Self | Execute$ SoulshiftAbility" + - "| TriggerController$ TriggeredCardController | TriggerDescription$ " + parse + - " (When this creature dies, you may return target Spirit card with converted mana cost " - + manacost + " or less from your graveyard to your hand.)"; - final String abString = "DB$ ChangeZone | Origin$ Graveyard | Destination$ Hand" + - "| ValidTgts$ Spirit.YouOwn+cmcLE" + manacost; + + final String actualTrigger = "Mode$ ChangesZone | Origin$ Battlefield | Destination$ Graveyard" + + "| OptionalDecider$ You | ValidCard$ Card.Self | Execute$ SoulshiftAbility" + + "| TriggerController$ TriggeredCardController | TriggerDescription$ " + parse + + " (When this creature dies, you may return target Spirit card with converted mana cost " + + manacost + " or less from your graveyard to your hand.)"; + final String abString = "DB$ ChangeZone | Origin$ Graveyard | Destination$ Hand" + + "| ValidTgts$ Spirit.YouOwn+cmcLE" + manacost; final Trigger parsedTrigger = TriggerHandler.parseTrigger(actualTrigger, card, true); card.addTrigger(parsedTrigger); card.setSVar("SoulshiftAbility", abString); @@ -4279,10 +4278,10 @@ public class CardFactoryUtil { re.setLayer(ReplacementLayer.Other); card.addReplacementEffect(re); - } else if(kw.equals("CARDNAME enters the battlefield tapped.")) { + } else if (kw.equals("CARDNAME enters the battlefield tapped.")) { String parse = kw; card.removeIntrinsicKeyword(parse); - + String abStr = "AB$ Tap | Cost$ 0 | Defined$ Self | ETB$ True | SubAbility$ MoveETB"; String dbStr = "DB$ ChangeZone | Hidden$ True | Origin$ All | Destination$ Battlefield" + "| Defined$ ReplacedCard"; @@ -4485,7 +4484,7 @@ public class CardFactoryUtil { final String parse = card.getKeyword().get(n).toString(); card.setCanMorph(true); - Map sVars = card.getSVars(); + Map sVars = card.getSVars(); final String[] k = parse.split(":"); final Cost cost = new Cost(card, k[1], true); @@ -4623,7 +4622,7 @@ public class CardFactoryUtil { public void execute() { // Target as Modular is Destroyed if (card.getController().isComputer()) { - List choices = + List choices = CardLists.filter(card.getController().getCardsIn(ZoneType.Battlefield), new Predicate() { @Override public boolean apply(final Card c) { @@ -4686,7 +4685,7 @@ public class CardFactoryUtil { card.setSVar("X", "Count$BloodthirstAmount"); } card.setSVar("X", "Count$BloodthirstAmount"); - + card.addIntrinsicKeyword("etbCounter:P1P1:" + numCounters + ":Bloodthirst$ True:" + desc); } // bloodthirst