forked from MagicBane/Server
Parsing enumsets for eq slots
This commit is contained in:
@@ -34,8 +34,8 @@ public class ItemTemplate {
|
||||
public Enum.ItemType item_type;
|
||||
public int item_eq_slots_value;
|
||||
public boolean item_eq_slots_type;
|
||||
public EnumSet<Enum.ItemEquipSlotType> item_eq_slots_or;
|
||||
public EnumSet<Enum.ItemEquipSlotType> item_eq_slots_and;
|
||||
public EnumSet<Enum.ItemEquipSlotType> item_eq_slots_or = EnumSet.noneOf(Enum.ItemEquipSlotType.class);
|
||||
public EnumSet<Enum.ItemEquipSlotType> item_eq_slots_and = EnumSet.noneOf(Enum.ItemEquipSlotType.class);
|
||||
|
||||
public ItemTemplate(JSONObject jsonObject) {
|
||||
|
||||
@@ -83,5 +83,11 @@ public class ItemTemplate {
|
||||
for (Object o : eq_slots_or)
|
||||
item_eq_slots_or.add(Enum.ItemEquipSlotType.valueOf((String) o));
|
||||
|
||||
JSONArray eq_slots_and = (JSONArray) jsonObject.get("eq_slots_and");
|
||||
|
||||
if (eq_slots_and.isEmpty() == false)
|
||||
for (Object o : eq_slots_or)
|
||||
item_eq_slots_and.add(Enum.ItemEquipSlotType.valueOf((String) o));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user