Browse Source

Effects.cfg parser

feature-config-parsing
FatBoy-DOTC 4 months ago
parent
commit
f81a1acb20
  1. 6
      src/engine/ConfigParsing/EffectsData/EffectData.java
  2. 6
      src/engine/ConfigParsing/EffectsParser.java

6
src/engine/ConfigParsing/EffectsData/EffectData.java

@ -1,12 +1,14 @@ @@ -1,12 +1,14 @@
package engine.ConfigParsing.EffectsData;
import engine.mbEnums;
import java.util.ArrayList;
public class EffectData {
public String id;
public String name;
public int icon;
public ArrayList<String> sources;
public ArrayList<Mod> mods;
public ArrayList<mbEnums.EffectSourceType> sources;
public ArrayList<mbEnums.ModType> mods;
public ArrayList<String> conditions;
}

6
src/engine/ConfigParsing/EffectsParser.java

@ -12,6 +12,8 @@ import engine.ConfigParsing.EffectsData.Condition; @@ -12,6 +12,8 @@ import engine.ConfigParsing.EffectsData.Condition;
import engine.ConfigParsing.EffectsData.EffectData;
import engine.ConfigParsing.EffectsData.Mod;
import engine.gameManager.ConfigManager;
import engine.mbEnums;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
@ -82,7 +84,7 @@ public class EffectsParser { @@ -82,7 +84,7 @@ public class EffectsParser {
for(String line : lines) {
if (line.contains("SOURCEBEGIN"))
{
data.sources.add(lines.get(index + 1).replace(" ", ""));
data.sources.add(mbEnums.EffectSourceType.valueOf(lines.get(index + 1).replace(" ", "")));
}
index++;
}
@ -105,7 +107,7 @@ public class EffectsParser { @@ -105,7 +107,7 @@ public class EffectsParser {
GenerateModValues(mod, lines.get(index + extra).replace(" ", "").replace(" ", "").split(" "));
extra++;
}
data.mods.add(mod);
data.mods.add(mbEnums.ModType.valueOf(mod.type));
}
index++;
}

Loading…
Cancel
Save