mirror of
https://github.com/magefree/mage.git
synced 2026-01-23 19:59:54 -08:00
tests: added verify check for wrong target tags usage, improved work with tagged targets (related to 8b2a81cb42)
This commit is contained in:
parent
3223d99b2a
commit
71b0613355
4 changed files with 121 additions and 36 deletions
|
|
@ -40,6 +40,18 @@ public class Targets extends ArrayList<Target> implements Copyable<Targets> {
|
|||
return this;
|
||||
}
|
||||
|
||||
public Target getByTag(int tag) {
|
||||
return this.stream().filter(t -> t.getTargetTag() == tag).findFirst().orElse(null);
|
||||
}
|
||||
|
||||
public List<UUID> getTargetsByTag(int tag) {
|
||||
Target target = getByTag(tag);
|
||||
if (target == null) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
return target.getTargets();
|
||||
}
|
||||
|
||||
public Target getNextUnchosen(Game game) {
|
||||
return getNextUnchosen(game, 0);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue