47 public static NamePick
pickName(String tag, String parent, LagrangePointType lagrangePoint) {
56 if (
isUsed(spec.getName()))
continue;
57 if (!spec.hasTag(tag))
continue;
58 if (parent ==
null && spec.getName().contains(
"$parent"))
continue;
59 if (spec.hasParent(parent)) {
60 picker.add(
new NamePick(spec, spec.getName(), spec.getSecondary()), spec.getFrequency());
66 if (picker.isEmpty()) {
68 if (
isUsed(spec.getName()))
continue;
69 if (!spec.hasTag(tag))
continue;
70 if (!spec.getParents().isEmpty())
continue;
71 if (parent ==
null && spec.getName().contains(
"$parent"))
continue;
72 picker.add(
new NamePick(spec, spec.getName(), spec.getSecondary()), spec.getFrequency());
78 if (picker.isEmpty()) {
80 for (
int i = 0; i < attempts; i++) {
82 if (name ==
null || name.name ==
null)
continue;
83 if (
isUsed(name.name))
continue;
86 NamePick pick =
new NamePick(data, name.name,
null);
95 if (picker.isEmpty()) {
96 OUTER:
for (Object obj : all) {
98 if (!spec.
hasTag(tag))
continue;
101 for (
int i = 2; i < 4000; i++) {
103 if (
isUsed(name))
continue;
104 if (parent ==
null && spec.
getName().contains(
"$parent"))
continue;
106 String secondary =
null;
110 picker.add(
new NamePick(spec, name, secondary), (4000f - i) * spec.
getFrequency());
116 NamePick pick = picker.pick();
119 pick.nameWithRomanSuffixIfAny =
doTokenReplacement(pick.nameWithRomanSuffixIfAny, parent, lagrangePoint);
120 if (pick.secondaryWithRomanSuffixIfAny !=
null) {
121 pick.secondaryWithRomanSuffixIfAny =
doTokenReplacement(pick.secondaryWithRomanSuffixIfAny, parent, lagrangePoint);