コード例 #1
0
ファイル: AbilityImpl.java プロジェクト: PwnedGalaxy/mage
 @Override
 public void addWatcher(Watcher watcher) {
   if (watchers == null) {
     watchers = new ArrayList<>();
   }
   watcher.setSourceId(this.sourceId);
   watcher.setControllerId(this.controllerId);
   watchers.add(watcher);
 }
コード例 #2
0
ファイル: GameState.java プロジェクト: sucramnosslin/mage
 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());
   }
 }
コード例 #3
0
ファイル: AbilityImpl.java プロジェクト: PwnedGalaxy/mage
 @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);
     }
   }
 }