[filters] minor changes

This commit is contained in:
North 2012-07-22 22:36:19 +03:00
parent 28fe29854c
commit 64dd5feda6
6 changed files with 13 additions and 13 deletions

View file

@ -59,8 +59,9 @@ public class FilterPermanent extends FilterObject<Permanent> {
}
public boolean match(Permanent permanent, UUID sourceId, UUID playerId, Game game) {
if (!this.match(permanent, game))
if (!this.match(permanent, game)) {
return false;
}
return Predicates.and(extraPredicates).apply(new ObjectSourcePlayer(permanent, sourceId, playerId), game);
}

View file

@ -70,18 +70,18 @@ public class FilterCreatureOrPlayer extends FilterImpl<Object> implements Filter
else if (o instanceof Permanent) {
return creatureFilter.match((Permanent)o, game);
}
return notFilter;
return false;
}
@Override
public boolean match(Object o, UUID sourceId, UUID controllerId, Game game) {
public boolean match(Object o, UUID sourceId, UUID playerId, Game game) {
if (o instanceof Player) {
return playerFilter.match((Player)o, sourceId, controllerId, game);
return playerFilter.match((Player)o, sourceId, playerId, game);
}
else if (o instanceof Permanent) {
return creatureFilter.match((Permanent)o, sourceId, controllerId, game);
return creatureFilter.match((Permanent)o, sourceId, playerId, game);
}
return notFilter;
return false;
}
public FilterCreaturePermanent getCreatureFilter() {

View file

@ -69,7 +69,7 @@ public class FilterPermanentOrPlayer extends FilterImpl<Object> implements Filte
} else if (o instanceof Permanent) {
return permanentFilter.match((Permanent) o, game);
}
return notFilter;
return false;
}
@Override
@ -79,7 +79,7 @@ public class FilterPermanentOrPlayer extends FilterImpl<Object> implements Filte
} else if (o instanceof Permanent) {
return permanentFilter.match((Permanent) o, sourceId, playerId, game);
}
return notFilter;
return false;
}
public FilterPermanent getPermanentFilter() {

View file

@ -72,7 +72,7 @@ public class FilterPermanentOrPlayerWithCounter extends FilterPermanentOrPlayer
} else if (o instanceof Permanent) {
return permanentFilter.match((Permanent) o, sourceId, playerId, game);
}
return notFilter;
return false;
}
@Override

View file

@ -71,7 +71,7 @@ public class FilterSpellOrPermanent extends FilterImpl<Object> implements Filter
} else if (o instanceof Permanent) {
return permanentFilter.match((Permanent) o, game);
}
return notFilter;
return false;
}
@Override
@ -81,7 +81,7 @@ public class FilterSpellOrPermanent extends FilterImpl<Object> implements Filter
} else if (o instanceof Permanent) {
return permanentFilter.match((Permanent) o, sourceId, playerId, game);
}
return notFilter;
return false;
}
public FilterPermanent getPermanentFilter() {

View file

@ -27,7 +27,6 @@
*/
package mage.filter.predicate.permanent;
import mage.Constants;
import mage.Constants.TargetController;
import mage.filter.predicate.ObjectPlayer;
import mage.filter.predicate.ObjectPlayerPredicate;
@ -42,7 +41,7 @@ import java.util.UUID;
*/
public class ControllerPredicate implements ObjectPlayerPredicate<ObjectPlayer<Controllable>> {
private Constants.TargetController controller;
private TargetController controller;
public ControllerPredicate(TargetController controller) {
this.controller = controller;