mirror of
https://github.com/correl/mage.git
synced 2025-01-12 19:25:44 +00:00
[filters] minor changes
This commit is contained in:
parent
28fe29854c
commit
64dd5feda6
6 changed files with 13 additions and 13 deletions
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue