More constructor work.

This commit is contained in:
2024-02-18 14:29:56 -05:00
parent 04d88d0523
commit 1ff2dc6733
+7
View File
@@ -43,6 +43,8 @@ public class ItemTemplate {
public int item_render_object_female;
public float item_health_full;
public EnumSet<Enum.CharacterSkills> 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));
}
}