tests: added verify check for wrong target tags usage, improved work with tagged targets (related to 8b2a81cb42)

This commit is contained in:
Oleg Agafonov 2025-06-01 08:54:24 +04:00
parent 3223d99b2a
commit 71b0613355
4 changed files with 121 additions and 36 deletions

View file

@ -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);
}