From 1ff2dc673325c2b5c2b97f588b3a682692128293 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Sun, 18 Feb 2024 14:29:56 -0500 Subject: [PATCH] More constructor work. --- src/engine/objects/ItemTemplate.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/engine/objects/ItemTemplate.java b/src/engine/objects/ItemTemplate.java index 479e9cd7..159e0fc8 100644 --- a/src/engine/objects/ItemTemplate.java +++ b/src/engine/objects/ItemTemplate.java @@ -43,6 +43,8 @@ public class ItemTemplate { public int item_render_object_female; public float item_health_full; + public EnumSet item_skill_used = EnumSet.noneOf(Enum.CharacterSkills.class); + public ItemTemplate(JSONObject jsonObject) { // Reading a String @@ -103,5 +105,10 @@ public class ItemTemplate { item_render_object_female = ((Long) jsonObject.get("item_render_object_female")).intValue(); item_health_full = ((Double) jsonObject.get("item_health_full")).floatValue(); + JSONArray skills_used = (JSONArray) jsonObject.get("item_skill_used"); + + if (skills_used.isEmpty() == false) + for (Object o : eq_slots_or) + item_skill_used.add(Enum.CharacterSkills.valueOf((String) o)); } }