From 5466c3e25c07907b9a858bf96a17a6a7c2e152b6 Mon Sep 17 00:00:00 2001 From: ShawnieBoy Date: Tue, 14 Apr 2015 12:14:08 +0100 Subject: [PATCH] refactor MagicLoseGameAction -> LoseGameAction --- src/magic/model/MagicPlayer.java | 6 +++--- src/magic/model/action/DrawAction.java | 2 +- .../{MagicLoseGameAction.java => LoseGameAction.java} | 6 +++--- src/magic/model/trigger/MagicIfPlayerWouldLoseTrigger.java | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) rename src/magic/model/action/{MagicLoseGameAction.java => LoseGameAction.java} (88%) diff --git a/src/magic/model/MagicPlayer.java b/src/magic/model/MagicPlayer.java index d44dc7a8fa..418e542ffc 100644 --- a/src/magic/model/MagicPlayer.java +++ b/src/magic/model/MagicPlayer.java @@ -5,7 +5,7 @@ import java.util.Collections; import java.util.List; import java.util.Set; import java.util.TreeSet; -import magic.model.action.MagicLoseGameAction; +import magic.model.action.LoseGameAction; import magic.model.choice.MagicBuilderManaCost; import magic.model.event.MagicActivationPriority; import magic.model.event.MagicSourceActivation; @@ -749,10 +749,10 @@ public class MagicPlayer extends MagicObjectImpl implements MagicTarget, MagicMa public void generateStateBasedActions() { if (getLife() <= 0) { - currGame.addDelayedAction(new MagicLoseGameAction(this,MagicLoseGameAction.LIFE_REASON)); + currGame.addDelayedAction(new LoseGameAction(this,LoseGameAction.LIFE_REASON)); } if (getPoison() >= LOSING_POISON) { - currGame.addDelayedAction(new MagicLoseGameAction(this,MagicLoseGameAction.POISON_REASON)); + currGame.addDelayedAction(new LoseGameAction(this,LoseGameAction.POISON_REASON)); } } diff --git a/src/magic/model/action/DrawAction.java b/src/magic/model/action/DrawAction.java index 958d0ac36f..468a01cd52 100644 --- a/src/magic/model/action/DrawAction.java +++ b/src/magic/model/action/DrawAction.java @@ -35,7 +35,7 @@ public class DrawAction extends MagicAction { for (int count=amount;count>0;count--) { if (library.isEmpty()) { if (MagicGame.LOSE_DRAW_EMPTY_LIBRARY) { - game.doAction(new MagicLoseGameAction(player,MagicLoseGameAction.DRAW_REASON)); + game.doAction(new LoseGameAction(player,LoseGameAction.DRAW_REASON)); } break; } diff --git a/src/magic/model/action/MagicLoseGameAction.java b/src/magic/model/action/LoseGameAction.java similarity index 88% rename from src/magic/model/action/MagicLoseGameAction.java rename to src/magic/model/action/LoseGameAction.java index bed760770a..43b40176c1 100644 --- a/src/magic/model/action/MagicLoseGameAction.java +++ b/src/magic/model/action/LoseGameAction.java @@ -5,7 +5,7 @@ import magic.model.MagicGame; import magic.model.MagicPlayer; import magic.model.trigger.MagicTriggerType; -public class MagicLoseGameAction extends MagicAction { +public class LoseGameAction extends MagicAction { public static final String LIFE_REASON = " lost the game."; public static final String POISON_REASON = " lost the game because of poisoning."; @@ -15,12 +15,12 @@ public class MagicLoseGameAction extends MagicAction { private MagicPlayer player; private MagicPlayer oldLosingPlayer = MagicPlayer.NONE; - public MagicLoseGameAction(final MagicPlayer aPlayer,final String aReason) { + public LoseGameAction(final MagicPlayer aPlayer,final String aReason) { player = aPlayer; reason = aReason; } - public MagicLoseGameAction(final MagicPlayer aPlayer) { + public LoseGameAction(final MagicPlayer aPlayer) { this(aPlayer, LIFE_REASON); } diff --git a/src/magic/model/trigger/MagicIfPlayerWouldLoseTrigger.java b/src/magic/model/trigger/MagicIfPlayerWouldLoseTrigger.java index 83ca1a9922..80395f9074 100644 --- a/src/magic/model/trigger/MagicIfPlayerWouldLoseTrigger.java +++ b/src/magic/model/trigger/MagicIfPlayerWouldLoseTrigger.java @@ -1,8 +1,8 @@ package magic.model.trigger; -import magic.model.action.MagicLoseGameAction; +import magic.model.action.LoseGameAction; -public abstract class MagicIfPlayerWouldLoseTrigger extends MagicTrigger { +public abstract class MagicIfPlayerWouldLoseTrigger extends MagicTrigger { public MagicIfPlayerWouldLoseTrigger(final int priority) { super(priority); }