removed lazy loading of predicates from TargetController

This commit is contained in:
Evan Kranzler 2020-01-07 10:32:34 -05:00
parent d16a4e5934
commit 463c208a39

View file

@ -27,29 +27,26 @@ public enum TargetController {
NEXT,
EACH_PLAYER;
private OwnerPredicate ownerPredicate = null;
private PlayerPredicate playerPredicate = null;
private ControllerPredicate controllerPredicate = null;
private final OwnerPredicate ownerPredicate;
private final PlayerPredicate playerPredicate;
private final ControllerPredicate controllerPredicate;
private TargetController() {
this.ownerPredicate = new OwnerPredicate(this);
this.playerPredicate = new PlayerPredicate(this);
this.controllerPredicate = new ControllerPredicate(this);
}
public OwnerPredicate getOwnerPredicate() {
if (this.ownerPredicate == null) {
this.ownerPredicate = new OwnerPredicate(this);
}
return this.ownerPredicate;
return ownerPredicate;
}
public PlayerPredicate getPlayerPredicate() {
if (this.playerPredicate == null) {
this.playerPredicate = new PlayerPredicate(this);
}
return this.playerPredicate;
return playerPredicate;
}
public ControllerPredicate getControllerPredicate() {
if (this.controllerPredicate == null) {
this.controllerPredicate = new ControllerPredicate(this);
}
return this.controllerPredicate;
return controllerPredicate;
}
public static class OwnerPredicate implements ObjectPlayerPredicate<ObjectPlayer<Card>> {