コード例 #1
0
        public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
        {
            OSRSItemSlot itemSlot = (OSRSItemSlot)value;

            switch (itemSlot)
            {
            case OSRSItemSlot.TwoHanded:
                writer.WriteValue("2h");
                break;

            default:
                writer.WriteValue(itemSlot.ToString().ToLower());
                break;
            }
        }
コード例 #2
0
        public static EquipIndex RStoTMSlot(OSRSItemSlot slot)
        {
            switch (slot)
            {
            case OSRSItemSlot.Hands:
                return(EquipIndex.LeftSide);

            case OSRSItemSlot.Ring:
                return(EquipIndex.RightSide);

            case OSRSItemSlot.Head:
                return(EquipIndex.Head);

            case OSRSItemSlot.Body:
                return(EquipIndex.Body);

            case OSRSItemSlot.Legs:
                return(EquipIndex.Legs);

            case OSRSItemSlot.Feet:
                return(EquipIndex.Feet);

            case OSRSItemSlot.Cape:
            case OSRSItemSlot.Neck:
                return(EquipIndex.Neck);

            case OSRSItemSlot.TwoHanded:
            case OSRSItemSlot.Weapon:
                return(EquipIndex.RightHand);

            case OSRSItemSlot.Shield:
            case OSRSItemSlot.Ammo:
            default:
                return(EquipIndex.LeftHand);
            }
        }