forked from MagicBane/Server
PowerEntry parsing work
This commit is contained in:
@@ -30,7 +30,7 @@ public class PowersParser {
|
|||||||
byte[] fileData = Files.readAllBytes(Paths.get(powersPath));
|
byte[] fileData = Files.readAllBytes(Paths.get(powersPath));
|
||||||
String fileContents = new String(fileData);
|
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);
|
Matcher matcher = POWER_REGEX.matcher(fileContents);
|
||||||
|
|
||||||
@@ -46,15 +46,22 @@ public class PowersParser {
|
|||||||
PowerEntry powerEntry = new PowerEntry();
|
PowerEntry powerEntry = new PowerEntry();
|
||||||
ArrayList<String> powerValues = new ArrayList<>();
|
ArrayList<String> powerValues = new ArrayList<>();
|
||||||
String[] powerEntries = powerData.trim().split("\n");
|
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())
|
Matcher matcher = STRSPLIT_REGEX.matcher(headerString);
|
||||||
powerValues.add(matcher.group(1).trim());
|
|
||||||
|
|
||||||
|
while (matcher.find())
|
||||||
|
powerHeader.add(matcher.group(1).trim());
|
||||||
|
|
||||||
|
for (int x = 2; x < powerEntries.length; x++) {
|
||||||
|
// Parse key/pair values
|
||||||
}
|
}
|
||||||
|
|
||||||
return powerEntry;
|
return powerEntry;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user