Refactoring

This commit is contained in:
magenoxx 2012-06-27 01:17:03 +04:00
parent be7d27d457
commit d602aac403
3 changed files with 8 additions and 2 deletions

View file

@ -274,7 +274,7 @@ public abstract class CardImpl<T extends CardImpl<T>> extends MageObjectImpl<T>
break;
case BATTLEFIELD:
PermanentCard permanent = new PermanentCard(this, ownerId);
game.getBattlefield().addPermanent(permanent);
game.addPermanent(permanent);
permanent.entersBattlefield(sourceId, game);
game.applyEffects();
if (flag)
@ -386,7 +386,7 @@ public abstract class CardImpl<T extends CardImpl<T>> extends MageObjectImpl<T>
}
updateZoneChangeCounter();
PermanentCard permanent = new PermanentCard(this, controllerId);
game.getBattlefield().addPermanent(permanent);
game.addPermanent(permanent);
game.setZone(objectId, Zone.BATTLEFIELD);
game.applyEffects();
permanent.entersBattlefield(sourceId, game);

View file

@ -165,6 +165,7 @@ public interface Game extends MageItem, Serializable {
public void emptyManaPools();
public void addEffect(ContinuousEffect continuousEffect, Ability source);
public void addEmblem(Emblem emblem, Ability source);
public void addPermanent(Permanent permanent);
/**
* This version supports copying of copies of any depth.

View file

@ -773,6 +773,11 @@ public abstract class GameImpl<T extends GameImpl<T>> implements Game, Serializa
state.addEmblem(newEmblem);
}
@Override
public void addPermanent(Permanent permanent) {
getBattlefield().addPermanent(permanent);
}
@Override
public void copyPermanent(Permanent copyFromPermanent, Permanent copyToPermanent, Ability source, ApplyToPermanent applier) {
Permanent permanent = copyFromPermanent.copy();