//20100423 - 800.4a
this.hand.clear();
this.graveyard.clear();
this.library.clear();
for (Iterator<Permanent> it = game.getBattlefield().getAllPermanents().iterator(); it.hasNext();) {
Permanent perm = it.next();
if (perm.getOwnerId().equals(playerId)) {
if (perm.getAttachedTo() != null) {
Permanent attachedTo = game.getPermanent(perm.getAttachedTo());
if (attachedTo != null)
attachedTo.removeAttachment(perm.getId(), game);
}
it.remove();
}
}
for (Iterator<StackObject> it = game.getStack().iterator(); it.hasNext();) {
StackObject object = it.next();
if (object.getControllerId().equals(playerId)) {
it.remove();
}
}
for (Iterator<Permanent> it = game.getBattlefield().getAllPermanents().iterator(); it.hasNext();) {
Permanent perm = it.next();
if (perm.getControllerId().equals(playerId)) {
perm.moveToExile(null, "", null, game);
}
}
}