Commanders can be other types than a creature.

Commanders do not have to be creatures. They can also be Planeswalkers (Commander 2015, Commander 2018), but also can be other types (e.g. lands when enchanted by Song of the Dryads or Imprisoned in the Moon).
This commit is contained in:
Piotr Szczepanski 2018-08-20 12:37:53 +02:00
parent 7310b80b78
commit ec7454d888

View file

@ -19,13 +19,12 @@ public class CommanderPredicate implements Predicate<Permanent> {
@Override @Override
public boolean apply(Permanent input, Game game) { public boolean apply(Permanent input, Game game) {
Player owner = game.getPlayer(input.getOwnerId()); Player owner = game.getPlayer(input.getOwnerId());
return input.isCreature() return owner != null
&& owner != null
&& owner.getCommandersIds().contains(input.getId()); && owner.getCommandersIds().contains(input.getId());
} }
@Override @Override
public String toString() { public String toString() {
return "Commander creature"; return "Commander";
} }
} }