[refactoring] Moved another field to FilterPermanent

This commit is contained in:
North 2012-07-13 23:08:10 +03:00
parent 13f744f09f
commit 4edee0b2f9
3 changed files with 11 additions and 16 deletions

View file

@ -41,7 +41,7 @@ import java.util.List;
*
* @author BetaSteward_at_googlemail.com
*/
public class FilterAbility<T extends Ability> extends FilterImpl<T, FilterAbility<T>> implements Filter<T> {
public class FilterAbility<T extends Ability> extends FilterImpl<T, FilterAbility<T>> {
protected static ListComparer<Outcome> compOutcome = new ListComparer<Outcome>();

View file

@ -32,16 +32,10 @@ import mage.MageObject;
/**
*
* @author BetaSteward_at_googlemail.com
* @author North
*/
public class FilterObject<E extends MageObject, T extends FilterObject<E, T>> extends FilterImpl<E, T> {
/**
* Indicates that filter shouldn't match the source.
*/
protected boolean another;
@Override
public FilterObject<E, T> copy() {
return new FilterObject<E, T>(this);
@ -53,14 +47,5 @@ public class FilterObject<E extends MageObject, T extends FilterObject<E, T>> ex
public FilterObject(FilterObject filter) {
super(filter);
this.another = filter.another;
}
public boolean isAnother() {
return another;
}
public void setAnother(boolean another) {
this.another = another;
}
}

View file

@ -55,6 +55,7 @@ public class FilterPermanent<T extends FilterPermanent<T>> extends FilterObject<
protected boolean phasedIn;
protected TargetController controller = TargetController.ANY;
protected TargetController owner = TargetController.ANY;
protected boolean another;
public FilterPermanent() {
super("permanent");
@ -76,6 +77,7 @@ public class FilterPermanent<T extends FilterPermanent<T>> extends FilterObject<
this.phasedIn = filter.phasedIn;
this.controller = filter.controller;
this.owner = filter.owner;
this.another = filter.another;
}
public FilterPermanent(String name) {
@ -204,6 +206,14 @@ public class FilterPermanent<T extends FilterPermanent<T>> extends FilterObject<
this.owner = owner;
}
public boolean isAnother() {
return another;
}
public void setAnother(boolean another) {
this.another = another;
}
public boolean matchOwner(UUID testOwnerId) {
if (ownerId.size() > 0 && ownerId.contains(testOwnerId) == notOwner)
return false;