diff options
| author | 2019-01-24 14:48:32 +0200 | |
|---|---|---|
| committer | 2019-01-24 13:48:32 +0100 | |
| commit | 00fcd0550fcdda621c2e4662f6ddd55ce673b931 (patch) | |
| tree | 6f9e4c24dbcc6d118fceec56adf7bf9d747a485c /src/main/java/cuchaz/enigma/translation/TranslationDirection.java | |
| parent | mark as 0.13.0-SNAPSHOT for preliminary development (diff) | |
| download | enigma-fork-00fcd0550fcdda621c2e4662f6ddd55ce673b931.tar.gz enigma-fork-00fcd0550fcdda621c2e4662f6ddd55ce673b931.tar.xz enigma-fork-00fcd0550fcdda621c2e4662f6ddd55ce673b931.zip | |
[WIP] Mapping rework (#91)
* Move packages
* Mapping & entry refactor: first pass
* Fix deobf -> obf tree remapping
* Resolve various issues
* Give all entries the potential for parents and treat inner classes as children
* Deobf UI tree elements
* Tests pass
* Sort mapping output
* Fix delta tracking
* Index separation and first pass for #97
* Keep track of remapped jar index
* Fix child entries not being remapped
* Drop non-root entries
* Track dropped mappings
* Fix enigma mapping ordering
* EntryTreeNode interface
* Small tweaks
* Naive full index remap on rename
* Entries can resolve to more than one root entry
* Support alternative resolution strategies
* Bridge method resolution
* Tests pass
* Fix mappings being used where there are none
* Fix methods with different descriptors being considered unique. closes #89
Diffstat (limited to 'src/main/java/cuchaz/enigma/translation/TranslationDirection.java')
| -rw-r--r-- | src/main/java/cuchaz/enigma/translation/TranslationDirection.java | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/main/java/cuchaz/enigma/translation/TranslationDirection.java b/src/main/java/cuchaz/enigma/translation/TranslationDirection.java new file mode 100644 index 0000000..2ecb30b --- /dev/null +++ b/src/main/java/cuchaz/enigma/translation/TranslationDirection.java | |||
| @@ -0,0 +1,36 @@ | |||
| 1 | /******************************************************************************* | ||
| 2 | * Copyright (c) 2015 Jeff Martin. | ||
| 3 | * All rights reserved. This program and the accompanying materials | ||
| 4 | * are made available under the terms of the GNU Lesser General Public | ||
| 5 | * License v3.0 which accompanies this distribution, and is available at | ||
| 6 | * http://www.gnu.org/licenses/lgpl.html | ||
| 7 | * <p> | ||
| 8 | * Contributors: | ||
| 9 | * Jeff Martin - initial API and implementation | ||
| 10 | ******************************************************************************/ | ||
| 11 | |||
| 12 | package cuchaz.enigma.translation; | ||
| 13 | |||
| 14 | public enum TranslationDirection { | ||
| 15 | |||
| 16 | DEOBFUSCATING { | ||
| 17 | @Override | ||
| 18 | public <T> T choose(T deobfChoice, T obfChoice) { | ||
| 19 | if (deobfChoice == null) { | ||
| 20 | return obfChoice; | ||
| 21 | } | ||
| 22 | return deobfChoice; | ||
| 23 | } | ||
| 24 | }, | ||
| 25 | OBFUSCATING { | ||
| 26 | @Override | ||
| 27 | public <T> T choose(T deobfChoice, T obfChoice) { | ||
| 28 | if (obfChoice == null) { | ||
| 29 | return deobfChoice; | ||
| 30 | } | ||
| 31 | return obfChoice; | ||
| 32 | } | ||
| 33 | }; | ||
| 34 | |||
| 35 | public abstract <T> T choose(T deobfChoice, T obfChoice); | ||
| 36 | } | ||