Exemplo n.º 1
0
 @Override
 public void addWatcher(Watcher watcher) {
   if (watchers == null) {
     watchers = new ArrayList<>();
   }
   watcher.setSourceId(this.sourceId);
   watcher.setControllerId(this.controllerId);
   watchers.add(watcher);
 }
Exemplo n.º 2
0
 @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);
     }
   }
 }
Exemplo n.º 3
0
 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());
   }
 }