|
|
|
@ -14,6 +14,9 @@ import engine.wpak.data.PowerActionEntry;
@@ -14,6 +14,9 @@ import engine.wpak.data.PowerActionEntry;
|
|
|
|
|
import java.io.IOException; |
|
|
|
|
import java.nio.file.Files; |
|
|
|
|
import java.nio.file.Paths; |
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
import java.util.Arrays; |
|
|
|
|
import java.util.Iterator; |
|
|
|
|
import java.util.regex.Matcher; |
|
|
|
|
import java.util.regex.Pattern; |
|
|
|
|
|
|
|
|
@ -51,6 +54,19 @@ public class PowerActionParser {
@@ -51,6 +54,19 @@ public class PowerActionParser {
|
|
|
|
|
private static PowerActionEntry parsePowerActionEntry(String powerActionData) { |
|
|
|
|
|
|
|
|
|
PowerActionEntry powerActionEntry = new PowerActionEntry(); |
|
|
|
|
// Remove all lines that contain a # and leading/trailing blank lines
|
|
|
|
|
|
|
|
|
|
powerActionData = powerActionData.replaceAll("(?m)^(\\s*#.*|\\s*)\r?\n?", "").trim(); |
|
|
|
|
|
|
|
|
|
String[] lineData = powerActionData.trim().split("\n"); |
|
|
|
|
|
|
|
|
|
// Parse effect entry header
|
|
|
|
|
|
|
|
|
|
Iterator iterator = Arrays.stream(lineData).iterator(); |
|
|
|
|
|
|
|
|
|
String headerLine = iterator.next().toString(); |
|
|
|
|
|
|
|
|
|
ArrayList<String> effectHeader = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
return powerActionEntry; |
|
|
|
|
} |
|
|
|
|