@Override public void addWatcher(Watcher watcher) { if (watchers == null) { watchers = new ArrayList<>(); } watcher.setSourceId(this.sourceId); watcher.setControllerId(this.controllerId); watchers.add(watcher); }
public void addCard(Card card) { setZone(card.getId(), Zone.OUTSIDE); for (Watcher watcher : card.getWatchers()) { watcher.setControllerId(card.getOwnerId()); watcher.setSourceId(card.getId()); watchers.add(watcher); } for (Ability ability : card.getAbilities()) { addAbility(ability, card); } if (card.isSplitCard()) { addCard(((SplitCard) card).getLeftHalfCard()); addCard(((SplitCard) card).getRightHalfCard()); } }
@Override public void setSourceId(UUID sourceId) { if (this.sourceId == null) { this.sourceId = sourceId; } else if (!(this instanceof MageSingleton)) { this.sourceId = sourceId; } if (subAbilities != null) { for (Ability subAbility : subAbilities) { subAbility.setSourceId(sourceId); } } if (watchers != null) { for (Watcher watcher : watchers) { watcher.setSourceId(sourceId); } } }