From f81a1acb207fac2011b237920a25ed73ab94533f Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Tue, 23 Jul 2024 21:15:37 -0500 Subject: [PATCH] Effects.cfg parser --- src/engine/ConfigParsing/EffectsData/EffectData.java | 6 ++++-- src/engine/ConfigParsing/EffectsParser.java | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/engine/ConfigParsing/EffectsData/EffectData.java b/src/engine/ConfigParsing/EffectsData/EffectData.java index 08604211..9a4e9b1e 100644 --- a/src/engine/ConfigParsing/EffectsData/EffectData.java +++ b/src/engine/ConfigParsing/EffectsData/EffectData.java @@ -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 sources; - public ArrayList mods; + public ArrayList sources; + public ArrayList mods; public ArrayList conditions; } diff --git a/src/engine/ConfigParsing/EffectsParser.java b/src/engine/ConfigParsing/EffectsParser.java index b6804532..fea0eb75 100644 --- a/src/engine/ConfigParsing/EffectsParser.java +++ b/src/engine/ConfigParsing/EffectsParser.java @@ -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 { 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 { GenerateModValues(mod, lines.get(index + extra).replace(" ", "").replace(" ", "").split(" ")); extra++; } - data.mods.add(mod); + data.mods.add(mbEnums.ModType.valueOf(mod.type)); } index++; }