PowerEntry parsing work

This commit is contained in:
2024-08-14 16:27:51 -04:00
parent 97c118ae1a
commit cd50ca4309
+12 -5
View File
@@ -30,7 +30,7 @@ public class PowersParser {
byte[] fileData = Files.readAllBytes(Paths.get(powersPath));
String fileContents = new String(fileData);
// Iterate over effect entries from .wpak data
// Iterate over power entries from .wpak data
Matcher matcher = POWER_REGEX.matcher(fileContents);
@@ -46,15 +46,22 @@ public class PowersParser {
PowerEntry powerEntry = new PowerEntry();
ArrayList<String> powerValues = new ArrayList<>();
String[] powerEntries = powerData.trim().split("\n");
ArrayList<String> powerHeader = new ArrayList<>();
for (String powerString : powerEntries) {
// Parse header
Matcher matcher = STRSPLIT_REGEX.matcher(powerString.trim());
String headerString = powerEntries[0] + powerEntries[1];
headerString = headerString.replace("\n", " ");
while (matcher.find())
powerValues.add(matcher.group(1).trim());
Matcher matcher = STRSPLIT_REGEX.matcher(headerString);
while (matcher.find())
powerHeader.add(matcher.group(1).trim());
for (int x = 2; x < powerEntries.length; x++) {
// Parse key/pair values
}
return powerEntry;
}