From 4808d411b3b6e4e237f7a7c336c751419e763d2b Mon Sep 17 00:00:00 2001 From: "Benjamin J. Culkin" Date: Tue, 29 Dec 2020 19:06:25 -0400 Subject: General update --- src/main/java/tlIItools/AffixSet.java | 36 ++++++++++------------------------- 1 file changed, 10 insertions(+), 26 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 d43b34e1..d6b950f6 100644 --- a/src/main/java/tlIItools/AffixSet.java +++ b/src/main/java/tlIItools/AffixSet.java @@ -2,50 +2,37 @@ package tlIItools; import java.util.*; -/** - * Container of a set of affixes. +/** Container of a set of affixes. * - * @author Ben Culkin - */ + * @author Ben Culkin */ 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; - } - - return a1.minLevel - a2.minLevel; + if (a1.minLevel == a2.minLevel) return a1.maxLevel - a2.maxLevel; + else return a1.minLevel - a2.minLevel; } } - /** - * All of the affix groups contained in this set. + /** All of the affix groups contained in this set. * * An affix group is a set of affixes that generally have the same or - * similar effects, but have different intensities or spawn levels. - */ + * similar effects, but have different intensities or spawn levels. */ public Map> affixGroups; - /** - * All of the ungrouped affixes contained in this set. - */ + /** All of the ungrouped affixes contained in this set. */ public Set ungroupedAffixes; - /** - * Create a new blank affix set. - */ + /** Create a new blank affix set. */ public AffixSet() { affixGroups = new TreeMap<>(); ungroupedAffixes = new TreeSet<>(new AffixComparator()); } - /** - * Add an affix to this set. + /** Add an affix to this set. * - * @param afx The affix to add. - */ + * @param afx The affix to add. */ public void addAffixByContents(Affix afx) { String afxGroup = afx.getAffixGroupName(); @@ -55,13 +42,10 @@ public class AffixSet { affixGroups.compute(afxGroup, (key, val) -> { if (val == null) { Set afxSet = new HashSet<>(); - afxSet.add(afx); - return afxSet; } else { val.add(afx); - return val; } }); -- cgit v1.2.3