Minor formatting.

This commit is contained in:
LevelX2 2015-03-24 21:33:11 +01:00
parent 47df4ad205
commit e62e2e605e

View file

@ -663,18 +663,16 @@ public abstract class AbilityImpl implements Ability {
@Override
public List<Watcher> getWatchers() {
if (watchers != null) {
if (watchers != null)
return watchers;
} else {
else
return emptyWatchers;
}
}
@Override
public void addWatcher(Watcher watcher) {
if (watchers == null) {
if (watchers == null)
watchers = new ArrayList<>();
}
watcher.setSourceId(this.sourceId);
watcher.setControllerId(this.controllerId);
watchers.add(watcher);
@ -682,18 +680,16 @@ public abstract class AbilityImpl implements Ability {
@Override
public List<Ability> getSubAbilities() {
if (subAbilities != null) {
if (subAbilities != null)
return subAbilities;
} else {
else
return emptyAbilities;
}
}
@Override
public void addSubAbility(Ability ability) {
if (subAbilities == null) {
if (subAbilities == null)
subAbilities = new ArrayList<>();
}
ability.setSourceId(this.sourceId);
ability.setControllerId(this.controllerId);
subAbilities.add(ability);
@ -886,10 +882,10 @@ public abstract class AbilityImpl implements Ability {
boolean found = false;
// unfortunately we need to handle double faced cards separately and only this way
if (object instanceof PermanentCard) {
if (((PermanentCard)object).canTransform()) {
PermanentCard permanent = (PermanentCard)object;
found = permanent.getSecondCardFace().getAbilities().contains(this) || permanent.getCard().getAbilities().contains(this);
}
// if (((PermanentCard)object).canTransform()) {
// PermanentCard permanent = (PermanentCard)object;
// found = permanent.getSecondCardFace().getAbilities().contains(this) || permanent.getCard().getAbilities().contains(this);
// }
} else {
// check if it's an ability that is temporary gained to a card
Abilities<Ability> otherAbilities = game.getState().getAllOtherAbilities(this.getSourceId());