Browse Source

Effects.cfg parser

feature-config-parsing
FatBoy-DOTC 4 months ago
parent
commit
56dd3cfa95
  1. 2
      src/engine/ConfigParsing/EffectsData/EffectData.java
  2. 4
      src/engine/ConfigParsing/EffectsData/Mod.java
  3. 4
      src/engine/ConfigParsing/EffectsParser.java

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

@ -9,6 +9,6 @@ public class EffectData {
public String name; public String name;
public int icon; public int icon;
public ArrayList<mbEnums.EffectSourceType> sources; public ArrayList<mbEnums.EffectSourceType> sources;
public ArrayList<mbEnums.ModType> mods; public ArrayList<Mod> mods;
public ArrayList<String> conditions; public ArrayList<String> conditions;
} }

4
src/engine/ConfigParsing/EffectsData/Mod.java

@ -1,8 +1,10 @@
package engine.ConfigParsing.EffectsData; package engine.ConfigParsing.EffectsData;
import engine.mbEnums;
import java.util.ArrayList; import java.util.ArrayList;
public class Mod { public class Mod {
public String type; public mbEnums.ModType type;
public ArrayList<String> values; public ArrayList<String> values;
} }

4
src/engine/ConfigParsing/EffectsParser.java

@ -103,11 +103,11 @@ public class EffectsParser {
while(!lines.get(index + extra).contains("MODSEND")) while(!lines.get(index + extra).contains("MODSEND"))
{ {
//data.mods.add(lines[index + extra].Replace(" ", "")); //data.mods.add(lines[index + extra].Replace(" ", ""));
mod.type = lines.get(index + extra).replace(" ", "").split(" ")[0]; mod.type = mbEnums.ModType.valueOf(lines.get(index + extra).replace(" ", "").split(" ")[0]);
GenerateModValues(mod, lines.get(index + extra).replace(" ", "").replace(" ", "").split(" ")); GenerateModValues(mod, lines.get(index + extra).replace(" ", "").replace(" ", "").split(" "));
extra++; extra++;
} }
data.mods.add(mbEnums.ModType.valueOf(mod.type)); data.mods.add(mod);
} }
index++; index++;
} }

Loading…
Cancel
Save