Consistent handling of wz files and their paths

This commit is contained in:
P0nk
2021-07-10 17:37:24 +02:00
parent 2193057fce
commit 14a405adb2
27 changed files with 106 additions and 82 deletions

View File

@@ -21,7 +21,6 @@
*/
package provider.wz;
import provider.MapleDataProviderFactory;
import tools.data.input.GenericLittleEndianAccessor;
import tools.data.input.InputStreamByteStream;
import tools.data.input.LittleEndianAccessor;
@@ -69,7 +68,7 @@ public class ListWZFile {
if (listWz != null) {
ListWZFile listwz;
try {
listwz = new ListWZFile(MapleDataProviderFactory.fileInWZPath("List.wz"));
listwz = new ListWZFile(WZFiles.LIST.getFile());
modernImgs = new HashSet<>(listwz.getEntries());
} catch (FileNotFoundException e) {
e.printStackTrace();

View File

@@ -0,0 +1,35 @@
package provider.wz;
import java.io.File;
public enum WZFiles {
QUEST("Quest"),
ETC("Etc"),
ITEM("Item"),
CHARACTER("Character"),
STRING("String"),
LIST("List"),
MOB("Mob"),
MAP("Map"),
NPC("Npc"),
REACTOR("Reactor"),
SKILL("Skill"),
SOUND("Sound"),
UI("UI");
public static final String DIRECTORY = "wz";
private final String fileName;
WZFiles(String fileName) {
this.fileName = fileName;
}
public File getFile() {
return new File(getFilePath());
}
public String getFilePath() {
return String.format("%s/%s.wz", DIRECTORY, fileName);
}
}