diff options
| author | Benjamin J. Culkin <bjculkin@mix.wvu.edu> | 2020-12-29 19:06:25 -0400 |
|---|---|---|
| committer | Benjamin J. Culkin <bjculkin@mix.wvu.edu> | 2020-12-29 19:06:25 -0400 |
| commit | 4808d411b3b6e4e237f7a7c336c751419e763d2b (patch) | |
| tree | 99fb8bf966d117e0b1b7e18fc660af7b7a87258d /src/main/java/tlIItools/AffixSet.java | |
| parent | eeaf62f7a2ac1d23c2a9876ad0c86795edf804ae (diff) | |
General update
Diffstat (limited to 'src/main/java/tlIItools/AffixSet.java')
| -rw-r--r-- | src/main/java/tlIItools/AffixSet.java | 36 |
1 files changed, 10 insertions, 26 deletions
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<Affix> { @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<String, Set<Affix>> affixGroups; - /** - * All of the ungrouped affixes contained in this set. - */ + /** All of the ungrouped affixes contained in this set. */ public Set<Affix> 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<Affix> afxSet = new HashSet<>(); - afxSet.add(afx); - return afxSet; } else { val.add(afx); - return val; } }); |
