changed line ending to LF

master
melvin 2012-10-14 21:55:54 +08:00
parent 66d8f229df
commit 05899c560a
1 changed files with 44 additions and 44 deletions

View File

@ -1,45 +1,45 @@
package magic.model.action;
import magic.model.MagicCard;
import magic.model.MagicGame;
import magic.model.MagicLocationType;
import magic.model.MagicPermanent;
public class MagicExileUntilThisLeavesPlayAction extends MagicAction {
private final MagicPermanent source;
private final MagicPermanent permanent;
private final MagicCard card;
private final MagicLocationType location;
public MagicExileUntilThisLeavesPlayAction(final MagicPermanent source,final MagicCard card,final MagicLocationType location) {
this.source = source;
this.permanent = MagicPermanent.NONE;
this.card = card;
this.location = location;
}
public MagicExileUntilThisLeavesPlayAction(final MagicPermanent source,final MagicPermanent permanent) {
this.source = source;
this.permanent = permanent;
this.card = permanent.getCard();
this.location = MagicLocationType.Exile;
}
@Override
public void doAction(final MagicGame game) {
if (permanent != MagicPermanent.NONE) {
game.doAction(new MagicRemoveFromPlayAction(permanent,location));
} else {
game.doAction(new MagicRemoveCardAction(card,location));
game.doAction(new MagicMoveCardAction(card,location,MagicLocationType.Exile));
}
source.addExiledCard(card);
}
@Override
public void undoAction(final MagicGame game) {
source.removeExiledCard(card);
}
package magic.model.action;
import magic.model.MagicCard;
import magic.model.MagicGame;
import magic.model.MagicLocationType;
import magic.model.MagicPermanent;
public class MagicExileUntilThisLeavesPlayAction extends MagicAction {
private final MagicPermanent source;
private final MagicPermanent permanent;
private final MagicCard card;
private final MagicLocationType location;
public MagicExileUntilThisLeavesPlayAction(final MagicPermanent source,final MagicCard card,final MagicLocationType location) {
this.source = source;
this.permanent = MagicPermanent.NONE;
this.card = card;
this.location = location;
}
public MagicExileUntilThisLeavesPlayAction(final MagicPermanent source,final MagicPermanent permanent) {
this.source = source;
this.permanent = permanent;
this.card = permanent.getCard();
this.location = MagicLocationType.Exile;
}
@Override
public void doAction(final MagicGame game) {
if (permanent != MagicPermanent.NONE) {
game.doAction(new MagicRemoveFromPlayAction(permanent,location));
} else {
game.doAction(new MagicRemoveCardAction(card,location));
game.doAction(new MagicMoveCardAction(card,location,MagicLocationType.Exile));
}
source.addExiledCard(card);
}
@Override
public void undoAction(final MagicGame game) {
source.removeExiledCard(card);
}
}