private ItemEquipmentCube MapCube(ItemId itemId, ItemEquipmentSlot slot) { if (!CubeHelper.IsCube(itemId)) { return(ItemEquipmentCube.None); } switch (slot) { case ItemEquipmentSlot.Head: case ItemEquipmentSlot.Shoulders: case ItemEquipmentSlot.Hands: case ItemEquipmentSlot.Wrists: case ItemEquipmentSlot.Waist: case ItemEquipmentSlot.Legs: case ItemEquipmentSlot.Feet: case ItemEquipmentSlot.Torso: return(ItemEquipmentCube.Armor); case ItemEquipmentSlot.Neck: case ItemEquipmentSlot.LeftFinger: case ItemEquipmentSlot.RightFinger: return(ItemEquipmentCube.Jewelery); case ItemEquipmentSlot.Mainhand: case ItemEquipmentSlot.Offhand: return(ItemEquipmentCube.Weapon); default: throw new ArgumentOutOfRangeException(); } }
public static bool TryItemEquipmentSlotFromString(string value, out ItemEquipmentSlot slot) { switch (value) { case "neck": slot = ItemEquipmentSlot.Neck; break; case "right-hand": case "offHand": // detailed-hero-items slot = ItemEquipmentSlot.Offhand; break; case "left-hand": case "mainHand": // detailed-hero-items slot = ItemEquipmentSlot.Mainhand; break; case "waist": slot = ItemEquipmentSlot.Waist; break; case "feet": slot = ItemEquipmentSlot.Feet; break; case "bracers": slot = ItemEquipmentSlot.Wrists; break; case "torso": slot = ItemEquipmentSlot.Torso; break; case "hands": slot = ItemEquipmentSlot.Hands; break; case "head": slot = ItemEquipmentSlot.Head; break; case "legs": slot = ItemEquipmentSlot.Legs; break; case "left-finger": case "leftFinger": // detailed-hero-items slot = ItemEquipmentSlot.LeftFinger; break; case "right-finger": case "rightFinger": // detailed-hero-items slot = ItemEquipmentSlot.RightFinger; break; case "shoulders": slot = ItemEquipmentSlot.Shoulders; break; case "follower-left-finger": case "follower-right-finger": case "follower-right-hand": case "follower-left-hand": case "follower-neck": slot = default; return(false); default: throw new DiabloApiEnumConversionException(nameof(value), value); } return(true); }