refactor MagicDrawAction -> DrawAction
parent
9feddcc645
commit
f17e0d48ef
|
@ -12,17 +12,17 @@ import magic.model.trigger.MagicTriggerType;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class MagicDrawAction extends MagicAction {
|
||||
public class DrawAction extends MagicAction {
|
||||
|
||||
private final MagicPlayer player;
|
||||
private final int amount;
|
||||
private List<MagicCard> drawnCards;
|
||||
|
||||
public MagicDrawAction(final MagicPlayer player) {
|
||||
public DrawAction(final MagicPlayer player) {
|
||||
this(player, 1);
|
||||
}
|
||||
|
||||
public MagicDrawAction(final MagicPlayer player,final int amount) {
|
||||
public DrawAction(final MagicPlayer player,final int amount) {
|
||||
this.player=player;
|
||||
this.amount=amount;
|
||||
}
|
|
@ -3,7 +3,7 @@ package magic.model.event;
|
|||
import magic.model.MagicGame;
|
||||
import magic.model.MagicPlayer;
|
||||
import magic.model.MagicSource;
|
||||
import magic.model.action.MagicDrawAction;
|
||||
import magic.model.action.DrawAction;
|
||||
|
||||
public class MagicDrawEvent extends MagicEvent {
|
||||
public MagicDrawEvent(final MagicSource source,final MagicPlayer player,final int amount) {
|
||||
|
@ -19,7 +19,7 @@ public class MagicDrawEvent extends MagicEvent {
|
|||
private static final MagicEventAction EVENT_ACTION=new MagicEventAction() {
|
||||
@Override
|
||||
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
||||
game.doAction(new MagicDrawAction(event.getPlayer(), event.getRefInt()));
|
||||
game.doAction(new DrawAction(event.getPlayer(), event.getRefInt()));
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ import magic.model.MagicGame;
|
|||
import magic.model.MagicSource;
|
||||
import magic.model.MagicLocationType;
|
||||
import magic.model.MagicPlayer;
|
||||
import magic.model.action.MagicDrawAction;
|
||||
import magic.model.action.DrawAction;
|
||||
import magic.model.action.MagicMoveCardAction;
|
||||
import magic.model.action.MagicRemoveCardAction;
|
||||
import magic.model.choice.MagicMulliganChoice;
|
||||
|
@ -42,7 +42,7 @@ public class MagicMulliganEvent extends MagicEvent {
|
|||
}
|
||||
final MagicCardList library = player.getLibrary();
|
||||
library.shuffle();
|
||||
game.doAction(new MagicDrawAction(player,size - 1));
|
||||
game.doAction(new DrawAction(player,size - 1));
|
||||
game.addEvent(new MagicMulliganEvent(player));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -629,7 +629,7 @@ public enum MagicRuleEventAction {
|
|||
return new MagicEventAction() {
|
||||
@Override
|
||||
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
||||
game.doAction(new MagicDrawAction(event.getPlayer(), amount));
|
||||
game.doAction(new DrawAction(event.getPlayer(), amount));
|
||||
game.doAction(new ChangeLifeAction(event.getPlayer(), -amount2));
|
||||
}
|
||||
};
|
||||
|
@ -646,7 +646,7 @@ public enum MagicRuleEventAction {
|
|||
return new MagicEventAction() {
|
||||
@Override
|
||||
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
||||
game.doAction(new MagicDrawAction(ARG.youPlayer(event, matcher), amount));
|
||||
game.doAction(new DrawAction(ARG.youPlayer(event, matcher), amount));
|
||||
}
|
||||
};
|
||||
}
|
||||
|
@ -684,7 +684,7 @@ public enum MagicRuleEventAction {
|
|||
@Override
|
||||
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
||||
for (final MagicPlayer player : game.filterPlayers(event.getPlayer(), filter)) {
|
||||
game.doAction(new MagicDrawAction(player, amount));
|
||||
game.doAction(new DrawAction(player, amount));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -748,7 +748,7 @@ public enum MagicRuleEventAction {
|
|||
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
||||
event.processTargetPlayer(game,new MagicPlayerAction() {
|
||||
public void doAction(final MagicPlayer player) {
|
||||
game.doAction(new MagicDrawAction(player,amount));
|
||||
game.doAction(new DrawAction(player,amount));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -767,7 +767,7 @@ public enum MagicRuleEventAction {
|
|||
return new MagicEventAction() {
|
||||
@Override
|
||||
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
||||
game.doAction(new MagicDrawAction(ARG.youPlayer(event, matcher), amount1));
|
||||
game.doAction(new DrawAction(ARG.youPlayer(event, matcher), amount1));
|
||||
game.addEvent(new MagicDiscardEvent(event.getSource(), ARG.youPlayer(event, matcher), amount2));
|
||||
}
|
||||
};
|
||||
|
@ -787,7 +787,7 @@ public enum MagicRuleEventAction {
|
|||
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
||||
event.processTargetPlayer(game,new MagicPlayerAction() {
|
||||
public void doAction(final MagicPlayer player) {
|
||||
game.doAction(new MagicDrawAction(player, amount1));
|
||||
game.doAction(new DrawAction(player, amount1));
|
||||
game.addEvent(new MagicDiscardEvent(event.getSource(), player, amount2));
|
||||
}
|
||||
});
|
||||
|
|
|
@ -2,7 +2,7 @@ package magic.model.phase;
|
|||
|
||||
import magic.model.MagicGame;
|
||||
import magic.model.MagicPlayer;
|
||||
import magic.model.action.MagicDrawAction;
|
||||
import magic.model.action.DrawAction;
|
||||
import magic.model.event.MagicExcludeEvent;
|
||||
import magic.model.trigger.MagicTriggerType;
|
||||
|
||||
|
@ -27,7 +27,7 @@ public class MagicDrawPhase extends MagicPhase {
|
|||
}
|
||||
|
||||
final MagicPlayer player=game.getTurnPlayer();
|
||||
game.doAction(new MagicDrawAction(player));
|
||||
game.doAction(new DrawAction(player));
|
||||
|
||||
game.executeTrigger(MagicTriggerType.AtDraw,game.getTurnPlayer());
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ package magic.model.trigger;
|
|||
import magic.model.MagicGame;
|
||||
import magic.model.MagicPermanent;
|
||||
import magic.model.MagicPlayer;
|
||||
import magic.model.action.MagicDrawAction;
|
||||
import magic.model.action.DrawAction;
|
||||
import magic.model.event.MagicEvent;
|
||||
import magic.model.event.MagicSourceEvent;
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ import magic.model.MagicGame;
|
|||
import magic.model.MagicPermanent;
|
||||
import magic.model.MagicPlayer;
|
||||
import magic.model.MagicSource;
|
||||
import magic.model.action.MagicDrawAction;
|
||||
import magic.model.action.DrawAction;
|
||||
import magic.model.action.MagicRemoveTriggerAction;
|
||||
import magic.model.event.MagicEvent;
|
||||
import magic.model.event.MagicSourceEvent;
|
||||
|
@ -42,7 +42,7 @@ public abstract class MagicAtUpkeepTrigger extends MagicTrigger<MagicPlayer> {
|
|||
}
|
||||
@Override
|
||||
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
||||
game.doAction(new MagicDrawAction(event.getPlayer()));
|
||||
game.doAction(new DrawAction(event.getPlayer()));
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue