From 1e0372c40daf738e1d59f47de6a25f5fc05e01c1 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Tue, 6 Aug 2024 16:56:41 -0400 Subject: [PATCH] HashSets for starters. --- .../{EffectsData => EffectEntry}/Condition.java | 2 +- .../ConfigParsing/EffectEntry/EffectEntry.java | 12 ++++++++++++ .../{EffectsData => EffectEntry}/Mod.java | 2 +- .../ConfigParsing/EffectsData/EffectData.java | 14 -------------- src/engine/ConfigParsing/EffectsParser.java | 9 ++++++--- 5 files changed, 20 insertions(+), 19 deletions(-) rename src/engine/ConfigParsing/{EffectsData => EffectEntry}/Condition.java (64%) create mode 100644 src/engine/ConfigParsing/EffectEntry/EffectEntry.java rename src/engine/ConfigParsing/{EffectsData => EffectEntry}/Mod.java (77%) delete mode 100644 src/engine/ConfigParsing/EffectsData/EffectData.java diff --git a/src/engine/ConfigParsing/EffectsData/Condition.java b/src/engine/ConfigParsing/EffectEntry/Condition.java similarity index 64% rename from src/engine/ConfigParsing/EffectsData/Condition.java rename to src/engine/ConfigParsing/EffectEntry/Condition.java index 17ae0cd7..3aa12f0e 100644 --- a/src/engine/ConfigParsing/EffectsData/Condition.java +++ b/src/engine/ConfigParsing/EffectEntry/Condition.java @@ -1,4 +1,4 @@ -package engine.ConfigParsing.EffectsData; +package engine.ConfigParsing.EffectEntry; public class Condition { public String type; diff --git a/src/engine/ConfigParsing/EffectEntry/EffectEntry.java b/src/engine/ConfigParsing/EffectEntry/EffectEntry.java new file mode 100644 index 00000000..f9121d7c --- /dev/null +++ b/src/engine/ConfigParsing/EffectEntry/EffectEntry.java @@ -0,0 +1,12 @@ +package engine.ConfigParsing.EffectEntry; + +import java.util.HashSet; + +public class EffectEntry { + public String id; + public String name; + public int icon; + public HashSet sources; + public HashSet mods; + public HashSet conditions; +} diff --git a/src/engine/ConfigParsing/EffectsData/Mod.java b/src/engine/ConfigParsing/EffectEntry/Mod.java similarity index 77% rename from src/engine/ConfigParsing/EffectsData/Mod.java rename to src/engine/ConfigParsing/EffectEntry/Mod.java index 558f4a0e..d5632e68 100644 --- a/src/engine/ConfigParsing/EffectsData/Mod.java +++ b/src/engine/ConfigParsing/EffectEntry/Mod.java @@ -1,4 +1,4 @@ -package engine.ConfigParsing.EffectsData; +package engine.ConfigParsing.EffectEntry; import engine.mbEnums; diff --git a/src/engine/ConfigParsing/EffectsData/EffectData.java b/src/engine/ConfigParsing/EffectsData/EffectData.java deleted file mode 100644 index 99c07693..00000000 --- a/src/engine/ConfigParsing/EffectsData/EffectData.java +++ /dev/null @@ -1,14 +0,0 @@ -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 conditions; -} diff --git a/src/engine/ConfigParsing/EffectsParser.java b/src/engine/ConfigParsing/EffectsParser.java index bb923b7e..af903ec9 100644 --- a/src/engine/ConfigParsing/EffectsParser.java +++ b/src/engine/ConfigParsing/EffectsParser.java @@ -6,10 +6,9 @@ // Magicbane Emulator Project © 2013 - 2024 // www.magicbane.com - package engine.ConfigParsing; -import engine.ConfigParsing.EffectsData.EffectData; +import engine.ConfigParsing.EffectEntry.EffectEntry; import engine.gameManager.ConfigManager; import java.io.IOException; @@ -24,7 +23,7 @@ import java.util.regex.Pattern; public class EffectsParser { public static String EffectsPath = ConfigManager.DEFAULT_DATA_DIR + "wpak/Effects.cfg"; - public static HashMap effect_data = new HashMap<>(); + public static HashMap effect_data = new HashMap<>(); private static final Pattern EFFECT_REGEX = Pattern.compile("(.+?)", Pattern.DOTALL); private static final Pattern SOURCE_REGEX = Pattern.compile("(.+?)", Pattern.DOTALL); private static final Pattern MODS_REGEX = Pattern.compile("(.+?)", Pattern.DOTALL); @@ -43,4 +42,8 @@ public class EffectsParser { } + private static void parseEffectEntry(String effectEntry) { + + + } }