diff options
| author | Ben Culkin <scorpress@gmail.com> | 2020-04-06 22:07:31 -0400 |
|---|---|---|
| committer | Ben Culkin <scorpress@gmail.com> | 2020-04-06 22:07:31 -0400 |
| commit | 22378ce01e058c09675e711e2b6c14d3f78dbda6 (patch) | |
| tree | 23279afdb394d715d54bd38a8f5801be71f08ffe /src/main/java/tlIItools | |
| parent | e6bed600cc6c17469da4b6fd93393b15ae9bf0f1 (diff) | |
Cleanup some warnings
Cleanup some warnings
Diffstat (limited to 'src/main/java/tlIItools')
| -rw-r--r-- | src/main/java/tlIItools/Affix.java | 39 | ||||
| -rw-r--r-- | src/main/java/tlIItools/Effect.java | 74 | ||||
| -rw-r--r-- | src/main/java/tlIItools/NameFileReader.java | 3 |
3 files changed, 113 insertions, 3 deletions
diff --git a/src/main/java/tlIItools/Affix.java b/src/main/java/tlIItools/Affix.java index f58fb7d7..94c985c6 100644 --- a/src/main/java/tlIItools/Affix.java +++ b/src/main/java/tlIItools/Affix.java @@ -81,6 +81,43 @@ public class Affix { */ public List<Effect> effects; + public boolean isInAffixGroup(Affix afx) { + if (effects == null) { + if (afx.effects != null) + return false; + } else if (!effects.equals(afx.effects)) + return false; + if (enchantSources == null) { + if (afx.enchantSources != null) + return false; + } else if (!enchantSources.equals(afx.enchantSources)) + return false; + if (equipTypes == null) { + if (afx.equipTypes != null) + return false; + } else if (!equipTypes.equals(afx.equipTypes)) + return false; + if (inNonEquip != afx.inNonEquip) + return false; + if (isEnchantment != afx.isEnchantment) + return false; + if (isPerson != afx.isPerson) + return false; + if (isSocketable != afx.isSocketable) + return false; + if (nonequipTypes == null) { + if (afx.nonequipTypes != null) + return false; + } else if (!nonequipTypes.equals(afx.nonequipTypes)) + return false; + if (socketableTypes == null) { + if (afx.socketableTypes != null) + return false; + } else if (!socketableTypes.equals(afx.socketableTypes)) + return false; + return true; + } + /* * Are invalid equip types being added? */ @@ -320,4 +357,6 @@ public class Affix { return afx; } + + } diff --git a/src/main/java/tlIItools/Effect.java b/src/main/java/tlIItools/Effect.java index 5c8b203a..04383417 100644 --- a/src/main/java/tlIItools/Effect.java +++ b/src/main/java/tlIItools/Effect.java @@ -371,6 +371,78 @@ public class Effect { return sb.toString(); } + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((damageType == null) ? 0 : damageType.hashCode()); + result = prime * result + (exclusive ? 1231 : 1237); + result = prime * result + ((graphOverride == null) ? 0 : graphOverride.hashCode()); + result = prime * result + (hasDuration ? 1231 : 1237); + result = prime * result + (isStatBonus ? 1231 : 1237); + result = prime * result + (isTransfer ? 1231 : 1237); + result = prime * result + ((name == null) ? 0 : name.hashCode()); + result = prime * result + (ownerLevel ? 1231 : 1237); + long temp; + temp = Double.doubleToLongBits(soakScale); + result = prime * result + (int) (temp ^ (temp >>> 32)); + result = prime * result + ((statName == null) ? 0 : statName.hashCode()); + result = prime * result + ((type == null) ? 0 : type.hashCode()); + result = prime * result + (useGraph ? 1231 : 1237); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + Effect other = (Effect) obj; + if (damageType == null) { + if (other.damageType != null) + return false; + } else if (!damageType.equals(other.damageType)) + return false; + if (exclusive != other.exclusive) + return false; + if (graphOverride == null) { + if (other.graphOverride != null) + return false; + } else if (!graphOverride.equals(other.graphOverride)) + return false; + if (hasDuration != other.hasDuration) + return false; + if (isStatBonus != other.isStatBonus) + return false; + if (isTransfer != other.isTransfer) + return false; + if (name == null) { + if (other.name != null) + return false; + } else if (!name.equals(other.name)) + return false; + if (ownerLevel != other.ownerLevel) + return false; + if (Double.doubleToLongBits(soakScale) != Double.doubleToLongBits(other.soakScale)) + return false; + if (statName == null) { + if (other.statName != null) + return false; + } else if (!statName.equals(other.statName)) + return false; + if (type == null) { + if (other.type != null) + return false; + } else if (!type.equals(other.type)) + return false; + if (useGraph != other.useGraph) + return false; + return true; + } + public static Effect parseEffect(Affix afx, Scanner scn, String scnSource) { return parseEffect(afx, scn, scnSource, new ArrayList<>()); } @@ -494,4 +566,6 @@ public class Effect { return efct; } + + } diff --git a/src/main/java/tlIItools/NameFileReader.java b/src/main/java/tlIItools/NameFileReader.java index c63ac417..87407162 100644 --- a/src/main/java/tlIItools/NameFileReader.java +++ b/src/main/java/tlIItools/NameFileReader.java @@ -107,8 +107,6 @@ public class NameFileReader { * * @param from * The name of the file to read from. - * - * @return The number of files read. */ public void readFrom(String from) { try (FileReader fr = new FileReader(from)) { @@ -126,7 +124,6 @@ public class NameFileReader { * @param r * The input source to read from. * - * @return The number of files read. */ public void readFrom(Reader r) { Scanner scn = new Scanner(r); |
