@Override public void addWatcher(Watcher watcher) { if (watchers == null) { watchers = new ArrayList<>(); } watcher.setSourceId(this.sourceId); watcher.setControllerId(this.controllerId); watchers.add(watcher); }
@Override public void setControllerId(UUID controllerId) { this.controllerId = controllerId; if (watchers != null) { for (Watcher watcher : watchers) { watcher.setControllerId(controllerId); } } if (subAbilities != null) { for (Ability subAbility : subAbilities) { subAbility.setControllerId(controllerId); } } }
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()); } }