From 56dd3cfa95745721656255cdf64e632ef8a0a955 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Tue, 23 Jul 2024 21:18:12 -0500 Subject: [PATCH] Effects.cfg parser --- src/engine/ConfigParsing/EffectsData/EffectData.java | 2 +- src/engine/ConfigParsing/EffectsData/Mod.java | 4 +++- src/engine/ConfigParsing/EffectsParser.java | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/engine/ConfigParsing/EffectsData/EffectData.java b/src/engine/ConfigParsing/EffectsData/EffectData.java index 9a4e9b1e..99c07693 100644 --- a/src/engine/ConfigParsing/EffectsData/EffectData.java +++ b/src/engine/ConfigParsing/EffectsData/EffectData.java @@ -9,6 +9,6 @@ public class EffectData { public String name; public int icon; public ArrayList sources; - public ArrayList mods; + public ArrayList mods; public ArrayList conditions; } diff --git a/src/engine/ConfigParsing/EffectsData/Mod.java b/src/engine/ConfigParsing/EffectsData/Mod.java index faeea81d..558f4a0e 100644 --- a/src/engine/ConfigParsing/EffectsData/Mod.java +++ b/src/engine/ConfigParsing/EffectsData/Mod.java @@ -1,8 +1,10 @@ package engine.ConfigParsing.EffectsData; +import engine.mbEnums; + import java.util.ArrayList; public class Mod { - public String type; + public mbEnums.ModType type; public ArrayList values; } diff --git a/src/engine/ConfigParsing/EffectsParser.java b/src/engine/ConfigParsing/EffectsParser.java index fea0eb75..64437204 100644 --- a/src/engine/ConfigParsing/EffectsParser.java +++ b/src/engine/ConfigParsing/EffectsParser.java @@ -103,11 +103,11 @@ public class EffectsParser { while(!lines.get(index + extra).contains("MODSEND")) { //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(" ")); extra++; } - data.mods.add(mbEnums.ModType.valueOf(mod.type)); + data.mods.add(mod); } index++; }