}
@Override
public boolean moveToZone(Zone toZone, UUID sourceId, Game game, boolean flag) {
Zone fromZone = game.getZone(objectId);
ZoneChangeEvent event = new ZoneChangeEvent(this.objectId, sourceId, ownerId, fromZone, toZone);
if (!game.replaceEvent(event)) {
switch (event.getToZone()) {
case GRAVEYARD:
game.getPlayer(ownerId).putInGraveyard(this, game, !flag);
break;
case HAND:
game.getPlayer(ownerId).getHand().add(this);
break;
case STACK:
game.getStack().push(new Spell(this, this.getSpellAbility().copy(), ownerId));
break;
case EXILED:
game.getExile().getPermanentExile().add(this);
break;
case LIBRARY:
if (flag)
game.getPlayer(ownerId).getLibrary().putOnTop(this, game);
else
game.getPlayer(ownerId).getLibrary().putOnBottom(this, game);
break;
case BATTLEFIELD:
PermanentCard permanent = new PermanentCard(this, ownerId);
game.getBattlefield().addPermanent(permanent);
permanent.entersBattlefield(sourceId, game);
game.applyEffects();
if (flag)
permanent.setTapped(true);
break;
}
game.setZone(objectId, event.getToZone());
game.fireEvent(event);
return game.getZone(objectId) == toZone;
}
return false;
}