Browse Source

More constructor work.

combat-2
MagicBot 9 months ago
parent
commit
1ff2dc6733
  1. 7
      src/engine/objects/ItemTemplate.java

7
src/engine/objects/ItemTemplate.java

@ -43,6 +43,8 @@ public class ItemTemplate {
public int item_render_object_female; public int item_render_object_female;
public float item_health_full; public float item_health_full;
public EnumSet<Enum.CharacterSkills> item_skill_used = EnumSet.noneOf(Enum.CharacterSkills.class);
public ItemTemplate(JSONObject jsonObject) { public ItemTemplate(JSONObject jsonObject) {
// Reading a String // Reading a String
@ -103,5 +105,10 @@ public class ItemTemplate {
item_render_object_female = ((Long) jsonObject.get("item_render_object_female")).intValue(); item_render_object_female = ((Long) jsonObject.get("item_render_object_female")).intValue();
item_health_full = ((Double) jsonObject.get("item_health_full")).floatValue(); 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));
} }
} }

Loading…
Cancel
Save