Browse Source

Effect Modifier parsing work.

feature-config-parsing2
MagicBot 5 months ago
parent
commit
975845375f
  1. 13
      src/engine/ConfigParsing/EffectsParser.java

13
src/engine/ConfigParsing/EffectsParser.java

@ -113,11 +113,18 @@ public class EffectsParser {
private static EffectModifier parseModEntry(String modData) { private static EffectModifier parseModEntry(String modData) {
EffectModifier effectModifier = new EffectModifier(); EffectModifier effectModifier = new EffectModifier();
ArrayList<String> modValues = new ArrayList<>();
String[] modEntries = modData.trim().split("\n"); String[] modEntries = modData.trim().split("\n");
effectModifier.type = mbEnums.ModType.valueOf(modEntries[0]); for (String modEntry : modEntries) {
ArrayList<String> modValues = new ArrayList<>();
Matcher matcher = STRSPLIT_REGEX.matcher(modEntry);
while (matcher.find())
modValues.add(matcher.group(1).trim());
effectModifier.type = mbEnums.ModType.valueOf(modValues.get(0).trim());
switch (effectModifier.type) { switch (effectModifier.type) {
case AnimOverride: case AnimOverride:
@ -127,8 +134,10 @@ public class EffectsParser {
default: default:
Logger.error("Unhandled type: " + effectModifier.type); Logger.error("Unhandled type: " + effectModifier.type);
break; break;
}
} }
return effectModifier; return effectModifier;
} }

Loading…
Cancel
Save