Browse Source

Parsing of effect description

feature-config-parsing2
MagicBot 4 months ago
parent
commit
d12d040def
  1. 17
      src/engine/ConfigParsing/EffectsParser.java

17
src/engine/ConfigParsing/EffectsParser.java

@ -49,6 +49,23 @@ public class EffectsParser { @@ -49,6 +49,23 @@ public class EffectsParser {
effectData.replaceAll("(?m)^.*#.*$", "");
// Parse effect entry description
String firstLine = effectData.substring(0, effectData.indexOf('\n'));
String[] effectDescription = firstLine.split(" ");
effectEntry.id = effectDescription[0];
effectEntry.name = effectDescription[1];
effectEntry.icon = Integer.parseInt(effectDescription[2]);
// Parse source entries
Matcher matcher = SOURCE_REGEX.matcher(effectData);
while (matcher.find())
effectEntry.sources.add(matcher.group(1).trim());
return effectEntry;
}

Loading…
Cancel
Save