init moved to configmanager.

This commit is contained in:
2024-08-19 20:38:09 -04:00
parent 00aa06c5f1
commit 9c1c4e02a9
4 changed files with 26 additions and 9 deletions
+8 -2
View File
@@ -32,11 +32,17 @@ public class EffectsParser {
private static final Pattern CONDITIONS_REGEX = Pattern.compile("(?<=CONDITIONBEGIN)(.+?)(?=CONDITIONEND)", Pattern.DOTALL);
private static final Pattern STRSPLIT_REGEX = Pattern.compile("([^\"]\\S*|\"[^\"]*\")\\s*"); // Regex ignores spaces within quotes
public static void parseWpakFile() throws IOException {
public static void parseWpakFile() {
// Read .wpak file from disk
byte[] fileData = Files.readAllBytes(Paths.get(effectsPath));
byte[] fileData = null;
try {
fileData = Files.readAllBytes(Paths.get(effectsPath));
} catch (IOException e) {
throw new RuntimeException(e);
}
String fileContents = new String(fileData);
// Iterate over effect entries from .wpak data
+8 -2
View File
@@ -28,11 +28,17 @@ public class PowersParser {
private static final Pattern CONDITION_REGEX = Pattern.compile("(?<=CONDITIONBEGIN)(.+?)(?=CONDITIONEND)", Pattern.DOTALL);
private static final String powersPath = ConfigManager.DEFAULT_DATA_DIR + "wpak/Powers.cfg";
public static void parseWpakFile() throws IOException {
public static void parseWpakFile() {
// Read .wpak file from disk
byte[] fileData = Files.readAllBytes(Paths.get(powersPath));
byte[] fileData = null;
try {
fileData = Files.readAllBytes(Paths.get(powersPath));
} catch (IOException e) {
throw new RuntimeException(e);
}
String fileContents = new String(fileData);
// Iterate over power entries from .wpak data