moved Watchers to Ability and moved Counters to CardState

This commit is contained in:
betasteward 2015-03-01 21:17:23 -05:00
parent 620a3b9a52
commit 632573fc3e
204 changed files with 1516 additions and 347 deletions

View file

@ -140,12 +140,17 @@ public class TriggeredAbilities extends ConcurrentHashMap<String, TriggeredAbili
* @param attachedTo - the object that gained the ability
*/
public void add(TriggeredAbility ability, UUID sourceId, MageObject attachedTo) {
this.add(ability, attachedTo);
List<UUID> uuidList = new LinkedList<>();
uuidList.add(sourceId);
// if the object that gained the ability moves zone, also then the triggered ability must be removed
uuidList.add(attachedTo.getId());
sources.put(getKey(ability, attachedTo), uuidList);
if (sourceId == null) {
add(ability, attachedTo);
}
else {
this.add(ability, attachedTo);
List<UUID> uuidList = new LinkedList<>();
uuidList.add(sourceId);
// if the object that gained the ability moves zone, also then the triggered ability must be removed
uuidList.add(attachedTo.getId());
sources.put(getKey(ability, attachedTo), uuidList);
}
}
public void add(TriggeredAbility ability, MageObject attachedTo) {