From fedb385feef3fb3e3419f4fc3c7d234fe8d5caec Mon Sep 17 00:00:00 2001 From: "Benjamin J. Culkin" Date: Thu, 31 Dec 2020 21:04:27 -0400 Subject: Work on affix groups more --- src/main/java/tlIItools/AffixSet.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/main/java/tlIItools/AffixSet.java') diff --git a/src/main/java/tlIItools/AffixSet.java b/src/main/java/tlIItools/AffixSet.java index 91c0dcd9..fa5c8d19 100644 --- a/src/main/java/tlIItools/AffixSet.java +++ b/src/main/java/tlIItools/AffixSet.java @@ -9,8 +9,7 @@ public class AffixSet { private static class AffixComparator implements Comparator { @Override public int compare(Affix a1, Affix a2) { - if (a1.minLevel == a2.minLevel) return a1.maxLevel - a2.maxLevel; - else return a1.minLevel - a2.minLevel; + return a1.spawnRange.compareTo(a2.spawnRange); } } @@ -29,14 +28,14 @@ public class AffixSet { ungroupedAffixes = new TreeSet<>(new AffixComparator()); } - + /** Add an affix to this set. * * @param afx The affix to add. */ public void addAffixByContents(Affix afx) { AffixGroup group = afx.toAffixGroup(); - String afxGroup = group.toString(); - + String afxGroup = group.toString(); + if (afxGroup.equals("")) { ungroupedAffixes.add(afx); } else { -- cgit v1.2.3