diff options
Diffstat (limited to 'src/main/java/cuchaz/enigma/mapping/Mappings.java')
| -rw-r--r-- | src/main/java/cuchaz/enigma/mapping/Mappings.java | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/main/java/cuchaz/enigma/mapping/Mappings.java b/src/main/java/cuchaz/enigma/mapping/Mappings.java index 912a57a..2166bb9 100644 --- a/src/main/java/cuchaz/enigma/mapping/Mappings.java +++ b/src/main/java/cuchaz/enigma/mapping/Mappings.java | |||
| @@ -15,11 +15,7 @@ import com.google.common.collect.Maps; | |||
| 15 | 15 | ||
| 16 | import java.io.File; | 16 | import java.io.File; |
| 17 | import java.io.IOException; | 17 | import java.io.IOException; |
| 18 | import java.util.ArrayList; | 18 | import java.util.*; |
| 19 | import java.util.Collection; | ||
| 20 | import java.util.List; | ||
| 21 | import java.util.Map; | ||
| 22 | import java.util.Set; | ||
| 23 | 19 | ||
| 24 | import com.google.common.collect.Sets; | 20 | import com.google.common.collect.Sets; |
| 25 | import cuchaz.enigma.analysis.TranslationIndex; | 21 | import cuchaz.enigma.analysis.TranslationIndex; |
| @@ -177,6 +173,16 @@ public class Mappings { | |||
| 177 | return classMapping != null && classMapping.containsDeobfField(deobfName, obfType); | 173 | return classMapping != null && classMapping.containsDeobfField(deobfName, obfType); |
| 178 | } | 174 | } |
| 179 | 175 | ||
| 176 | public boolean containsDeobfField(ClassEntry obfClassEntry, String deobfName) { | ||
| 177 | ClassMapping classMapping = this.classesByObf.get(obfClassEntry.getName()); | ||
| 178 | if (classMapping != null) | ||
| 179 | for (FieldMapping fieldMapping : classMapping.fields()) | ||
| 180 | if (deobfName.equals(fieldMapping.getDeobfName()) || deobfName.equals(fieldMapping.getObfName())) | ||
| 181 | return true; | ||
| 182 | |||
| 183 | return false; | ||
| 184 | } | ||
| 185 | |||
| 180 | public boolean containsDeobfMethod(ClassEntry obfClassEntry, String deobfName, Signature obfSignature) { | 186 | public boolean containsDeobfMethod(ClassEntry obfClassEntry, String deobfName, Signature obfSignature) { |
| 181 | ClassMapping classMapping = this.classesByObf.get(obfClassEntry.getName()); | 187 | ClassMapping classMapping = this.classesByObf.get(obfClassEntry.getName()); |
| 182 | return classMapping != null && classMapping.containsDeobfMethod(deobfName, obfSignature); | 188 | return classMapping != null && classMapping.containsDeobfMethod(deobfName, obfSignature); |