diff options
| author | Benjamin J. Culkin <bjculkin@mix.wvu.edu> | 2020-12-31 21:04:27 -0400 |
|---|---|---|
| committer | Benjamin J. Culkin <bjculkin@mix.wvu.edu> | 2020-12-31 21:04:27 -0400 |
| commit | fedb385feef3fb3e3419f4fc3c7d234fe8d5caec (patch) | |
| tree | c7d92ef28eb0645bc2a49fd0ea0e2a94993fc8b1 /src/main/java/tlIItools/AffixGroup.java | |
| parent | 4c5e20a6e78f72a749c517c6fcc75c176155b7c5 (diff) | |
Work on affix groups more
Diffstat (limited to 'src/main/java/tlIItools/AffixGroup.java')
| -rw-r--r-- | src/main/java/tlIItools/AffixGroup.java | 75 |
1 files changed, 51 insertions, 24 deletions
diff --git a/src/main/java/tlIItools/AffixGroup.java b/src/main/java/tlIItools/AffixGroup.java index 4069c632..61aab596 100644 --- a/src/main/java/tlIItools/AffixGroup.java +++ b/src/main/java/tlIItools/AffixGroup.java @@ -11,15 +11,15 @@ import tlIItools.Affix.*; * or have effects of differing intensity. * * @author Ben Culkin */ -public class AffixGroup { +public class AffixGroup implements Comparable<AffixGroup> { public List<EffectGroup> effects; - /** The types of equipment this can spawn on. */ + /** The types of enchanters who can add this. */ public List<String> enchantSources; /** The types of equipment this can spawn on. */ public List<String> equipTypes; - /** The types of equipment this can spawn on. */ + /** The types of equipment this cannot spawn on. */ public List<String> nonequipTypes; - /** The types of equipment this can spawn on. */ + /** The types of equipment this can be socketed into on. */ public List<String> socketableTypes; /** The type of thing this affix applies to. */ @@ -27,10 +27,10 @@ public class AffixGroup { /** Create a new affix group. */ public AffixGroup() { - effects = new ArrayList<>(); - enchantSources = new ArrayList<>(); - equipTypes = new ArrayList<>(); - nonequipTypes = new ArrayList<>(); + effects = new ArrayList<>(); + enchantSources = new ArrayList<>(); + equipTypes = new ArrayList<>(); + nonequipTypes = new ArrayList<>(); socketableTypes = new ArrayList<>(); } @@ -50,26 +50,53 @@ public class AffixGroup { return afx.toAffixGroup().equals(this); } - /** Get the 'header' for displaying this group - * - * @return The header for this group. */ - public String groupHeader() { - StringBuilder sb = new StringBuilder(); - - sb.append("ID: " + hashCode()); - - return sb.toString(); - } - + public String groupSummary() { + StringBuilder sb = new StringBuilder(); + + sb.append("Affix Type: "); + sb.append(type); + sb.append("\n"); +/* sb.append("Effects: \n"); + for (EffectGroup group : effects) { + sb.append("\t"); + sb.append(group); + sb.append("\n"); + } +*/ + + sb.append("Affix can spawn on: "); + sb.append(String.join(", ", equipTypes)); + sb.append("\nAffix can't spawn on: "); + sb.append(String.join(", ", nonequipTypes)); + sb.append("\n"); + + if (type == AffixType.SOCKETABLE) { + sb.append("Affix can be socketed into: "); + sb.append(String.join(", ", socketableTypes)); + sb.append("\n"); + } else if (type == AffixType.ENCHANTMENT) { + sb.append("Affix can be enchanted by: "); + sb.append(String.join(", ", socketableTypes)); + sb.append("\n"); + } + + return sb.toString(); + } + + @Override + public int compareTo(AffixGroup other) { + return toString().compareTo(other.toString()); + } + @Override public String toString() { StringBuilder sb = new StringBuilder(); - for (EffectGroup group : effects) sb.append(group); - for (String enchantSource : enchantSources) sb.append(enchantSource); - for (String equipType : equipTypes) sb.append(equipType); - for (String nonEquipType : nonequipTypes) sb.append(nonEquipType); - for (String socketableType : socketableTypes) sb.append(socketableType); + for (EffectGroup group: effects) sb.append(group); + for (String enchantSource: enchantSources) sb.append(enchantSource); + for (String equipType: equipTypes) sb.append(equipType); + for (String nonEquipType: nonequipTypes) sb.append(nonEquipType); + for (String socketableType: socketableTypes) sb.append(socketableType); return sb.toString(); } |
