From ecebe7e13da521a79e33a819d12fff799c2c4ba0 Mon Sep 17 00:00:00 2001 From: drdev Date: Sun, 12 Oct 2014 01:42:21 +0000 Subject: [PATCH] Remove unnecessary comments --- .../src/main/java/forge/game/GameAction.java | 249 +----------------- 1 file changed, 8 insertions(+), 241 deletions(-) diff --git a/forge-game/src/main/java/forge/game/GameAction.java b/forge-game/src/main/java/forge/game/GameAction.java index 04fdc1067ec..7379be60f6c 100644 --- a/forge-game/src/main/java/forge/game/GameAction.java +++ b/forge-game/src/main/java/forge/game/GameAction.java @@ -66,12 +66,6 @@ import java.util.Map.Entry; * @version $Id$ */ public class GameAction { - /** - *

- * resetActivationsPerTurn. - *

- */ - private final Game game; public GameAction(Game game0) { @@ -89,20 +83,6 @@ public class GameAction { } } - /** - *

- * changeZone. - *

- * - * @param zoneFrom - * a {@link forge.game.zone.PlayerZone} object. - * @param zoneTo - * a {@link forge.game.zone.PlayerZone} object. - * @param c - * a {@link forge.game.card.Card} object. - * @param position TODO - * @return a {@link forge.game.card.Card} object. - */ public Card changeZone(final Zone zoneFrom, Zone zoneTo, final Card c, Integer position) { if (c.isCopiedSpell() || (c.isImmutable() && zoneTo.is(ZoneType.Exile))) { // Remove Effect from command immediately, this is essential when some replacement @@ -329,11 +309,6 @@ public class GameAction { return copied; } - /** - * TODO: Write javadoc for this method. - * @param c - * @param copied - */ private void unattachCardLeavingBattlefield(Card copied) { // Handle unequipping creatures if (copied.isEquipped()) { @@ -377,21 +352,9 @@ public class GameAction { } } - /** - *

- * moveTo. - *

- * - * @param zoneTo - * a {@link forge.game.zone.PlayerZone} object. - * @param c - * a {@link forge.game.card.Card} object. - * @return a {@link forge.game.card.Card} object. - */ public final Card moveTo(final Zone zoneTo, Card c) { // FThreads.assertExecutedByEdt(false); // This code must never be executed from EDT, // use FThreads.invokeInNewThread to run code in a pooled thread - return moveTo(zoneTo, c, null); } @@ -431,12 +394,6 @@ public class GameAction { return c; } - /** - * Controller change zone correction. - * - * @param c - * a Card object - */ public final void controllerChangeZoneCorrection(final Card c) { System.out.println("Correcting zone for " + c.toString()); final Zone oldBattlefield = game.getZoneOf(c); @@ -481,29 +438,11 @@ public class GameAction { c.runChangeControllerCommands(); } - /** - *

- * moveToStack. - *

- * - * @param c - * a {@link forge.game.card.Card} object. - * @return a {@link forge.game.card.Card} object. - */ public final Card moveToStack(final Card c) { final Zone stack = game.getStackZone(); return moveTo(stack, c); } - /** - *

- * moveToGraveyard. - *

- * - * @param c - * a {@link forge.game.card.Card} object. - * @return a {@link forge.game.card.Card} object. - */ public final Card moveToGraveyard(Card c) { final Player owner = c.getOwner(); final PlayerZone grave = owner.getZone(ZoneType.Graveyard); @@ -514,116 +453,41 @@ public class GameAction { } // must put card in OWNER's graveyard not controller's - c = moveTo(grave, c); - - return c; + return moveTo(grave, c); } - - /** - *

- * moveToHand. - *

- * - * @param c - * a {@link forge.game.card.Card} object. - * @return a {@link forge.game.card.Card} object. - */ public final Card moveToHand(final Card c) { final PlayerZone hand = c.getOwner().getZone(ZoneType.Hand); return moveTo(hand, c); } - /** - *

- * moveToPlay. - *

- * - * @param c - * a {@link forge.game.card.Card} object. - * @return a {@link forge.game.card.Card} object. - */ public final Card moveToPlay(final Card c) { final PlayerZone play = c.getController().getZone(ZoneType.Battlefield); return moveTo(play, c); } - /** - *

- * moveToPlay. - *

- * - * @param c - * a {@link forge.game.card.Card} object. - * @param p - * a {@link forge.game.player.Player} object. - * @return a {@link forge.game.card.Card} object. - */ public final Card moveToPlay(final Card c, final Player p) { // move to a specific player's Battlefield final PlayerZone play = p.getZone(ZoneType.Battlefield); return moveTo(play, c); } - /** - *

- * moveToBottomOfLibrary. - *

- * - * @param c - * a {@link forge.game.card.Card} object. - * @return a {@link forge.game.card.Card} object. - */ public final Card moveToBottomOfLibrary(final Card c) { return moveToLibrary(c, -1); } - /** - *

- * moveToLibrary. - *

- * - * @param c - * a {@link forge.game.card.Card} object. - * @return a {@link forge.game.card.Card} object. - */ public final Card moveToLibrary(final Card c) { return moveToLibrary(c, 0); } - /** - *

- * moveToLibrary. - *

- * - * @param c - * a {@link forge.game.card.Card} object. - * @param libPosition - * a int. - * @return a {@link forge.game.card.Card} object. - */ public final Card moveToLibrary(Card c, int libPosition) { final PlayerZone library = c.getOwner().getZone(ZoneType.Library); - if (libPosition == -1 || libPosition > library.size()) { libPosition = library.size(); } return changeZone(game.getZoneOf(c), library, c, libPosition); } - /** - *

- * moveToVariantDeck. - *

- * - * @param c - * a {@link forge.game.card.Card} object. - * @param zone - * a {@link forge.game.card.Card} object. - * @param deckPosition - * a int. - * @return a {@link forge.game.card.Card} object. - */ public final Card moveToVariantDeck(Card c, ZoneType zone, int deckPosition) { final PlayerZone deck = c.getOwner().getZone(zone); if (deckPosition == -1 || deckPosition > deck.size()) { @@ -632,15 +496,6 @@ public class GameAction { return changeZone(game.getZoneOf(c), deck, c, deckPosition); } - /** - *

- * exile. - *

- * - * @param c - * a {@link forge.game.card.Card} object. - * @return a {@link forge.game.card.Card} object. - */ public final Card exile(final Card c) { if (game.isCardExiled(c)) { return c; @@ -649,32 +504,10 @@ public class GameAction { return moveTo(removed, c); } - /** - * Move to. - * - * @param name - * the name - * @param c - * the c - * @return the card - */ public final Card moveTo(final ZoneType name, final Card c) { return moveTo(name, c, 0); } - /** - *

- * moveTo. - *

- * - * @param name - * a {@link java.lang.String} object. - * @param c - * a {@link forge.game.card.Card} object. - * @param libPosition - * a int. - * @return a {@link forge.game.card.Card} object. - */ public final Card moveTo(final ZoneType name, final Card c, final int libPosition) { // Call specific functions to set PlayerZone, then move onto moveTo switch(name) { @@ -691,13 +524,6 @@ public class GameAction { } } - /** - * @param fireEvents - * {@code true} to have this method fire events about changed - * cards. - * @return the cards that are affected by static abilities, or {@code null} - * if no cards were affected. - */ public final Set checkStaticAbilities(final boolean fireEvents) { if (game.isGameOver()) { return null; @@ -808,16 +634,6 @@ public class GameAction { return affectedCards; } - /** - *

- * checkStateEffects. - *

- * - * @param runEvents - * {@code true} to have this method run - * {@link GameEventCardStatsChanged} events. - * @return a set of affected cards. - */ public final Set checkStateEffects(final boolean runEvents) { // sol(10/29) added for Phase updates, state effects shouldn't be // checked during Spell Resolution (except when persist-returning @@ -947,13 +763,8 @@ public class GameAction { } return allAffectedCards; - } // checkStateEffects() + } - /** - * TODO: Write javadoc for this method. - * @param c - * @return - */ private boolean stateBasedAction704_5n(Card c) { boolean checkAgain = false; if (!c.isAura()) { @@ -1019,7 +830,7 @@ public class GameAction { checkAgain = true; } } - } // if isEquipped() + } if (c.isFortified()) { for (final Card f : c.getFortifiedBy(true)) { @@ -1028,7 +839,7 @@ public class GameAction { checkAgain = true; } } - } // if isFortified() + } if (c.isEquipping()) { final Card equippedCreature = c.getEquipping(); @@ -1044,7 +855,7 @@ public class GameAction { c.unEquipCard(equippedCreature); checkAgain = true; } - } // if isEquipping() + } if (c.isFortifying()) { final Card fortifiedLand = c.getFortifying(); @@ -1058,7 +869,7 @@ public class GameAction { c.unFortifyCard(fortifiedLand); checkAgain = true; } - } // if isFortifying() + } return checkAgain; } @@ -1168,11 +979,6 @@ public class GameAction { game.getStack().clearSimultaneousStack(); } - /** - *

- * destroyPlaneswalkers. - *

- */ private boolean handlePlaneswalkerRule(Player p) { // get all Planeswalkers final List list = CardLists.filter(p.getCardsIn(ZoneType.Battlefield), CardPredicates.Presets.PLANEWALKERS); @@ -1213,11 +1019,6 @@ public class GameAction { return recheck; } - /** - *

- * destroyLegendaryCreatures. - *

- */ private boolean handleLegendRule(Player p) { final List a = CardLists.getType(p.getCardsIn(ZoneType.Battlefield), "Legendary"); if (a.isEmpty() || game.getStaticEffects().getGlobalRuleChange(GlobalRuleChange.noLegendRule)) { @@ -1253,7 +1054,7 @@ public class GameAction { } return recheck; - } // destroyLegendaryCreatures() + } private boolean handleWorldRule() { final List worlds = CardLists.getType(game.getCardsIn(ZoneType.Battlefield), "World"); @@ -1305,15 +1106,6 @@ public class GameAction { return newCard; } - /** - *

- * destroy. - *

- * - * @param c - * a {@link forge.game.card.Card} object. - * @return a boolean. - */ public final boolean destroy(final Card c, final SpellAbility sa) { if (!c.canBeDestroyed()) { return false; @@ -1334,19 +1126,9 @@ public class GameAction { return false; } - return destroyNoRegeneration(c, sa); } - /** - *

- * destroyNoRegeneration. - *

- * - * @param c - * a {@link forge.game.card.Card} object. - * @return a boolean. - */ public final boolean destroyNoRegeneration(final Card c, final SpellAbility sa) { Player activator = null; if (!c.canBeDestroyed()) { @@ -1388,15 +1170,6 @@ public class GameAction { return sacrificed != null; } - /** - *

- * addSuspendTriggers. - *

- * - * @param c - * a {@link forge.game.card.Card} object. - * @return a {@link forge.game.card.Card} object. - */ private static Card addSuspendTriggers(final Card c) { if (c.getSVar("HasteFromSuspend").equals("True")) { return c; @@ -1434,12 +1207,6 @@ public class GameAction { } /** - *

- * sacrificeDestroy. - *

- * - * @param c - * a {@link forge.game.card.Card} object. * @return the sacrificed Card in its new location, or {@code null} if the * sacrifice wasn't successful. */ @@ -1493,7 +1260,7 @@ public class GameAction { game.getStack().addSimultaneousStackEntry(undyingAb); } return newCard; - } // sacrificeDestroy() + } public void reveal(CardCollectionView cards, Player cardOwner) { reveal(cards, cardOwner, true);