Exemplo n.º 1
0
    public static void GetItemAction(this EquipmentInfo _eq, ItemActionType _type)
    {
        switch (_type)
        {
        case ItemActionType.NormalLeft:
            if (_eq.Slot != EquipSlot.None)
            {
                if (_eq.BelongTo == EquipmentBelongTo.EQUIP)
                {
                    _eq.TryToTakeOff();
                }
                else
                {
                    if (_eq.Family == EquipmentFamily.MOUNTEQUIP)
                    {
                        _eq.TryToWieldMountEquip();
                    }
                    else
                    {
                        _eq.TryToUse();
                    }
                }
            }
            break;

        case ItemActionType.NormalMiddle:
            if (_eq.Slot != EquipSlot.None)
            {
                if (_eq.BelongTo == EquipmentBelongTo.BACKPACK)
                {
                    if (_eq.Family != EquipmentFamily.COSMETIC && _eq.Family != EquipmentFamily.GEM)
                    {
                        _eq.TryToDecompose();
                    }
                }
                else if (_eq.BelongTo == EquipmentBelongTo.EQUIP)
                {
                    if (_eq.Family != EquipmentFamily.COSMETIC && _eq.Family != EquipmentFamily.GEM)
                    {
                        _eq.TryToStrengEquip();
                    }
                }
            }
            else if (_eq.CanDiscard)
            {
                _eq.TryToDiscard();
            }
            break;

        case ItemActionType.NormalRight:
            _eq.TryToFlaunt();
            break;

        case ItemActionType.TryToUse:
            _eq.TryToUse();
            break;

        case ItemActionType.StoreSell:
            _eq.TryToSell();
            break;

        case ItemActionType.TryTakeOff:
            _eq.TryToTakeOff();
            break;

        case ItemActionType.StrengEquipment:
            _eq.TryToStrengEquip();
            break;

        case ItemActionType.ChangeCosmeticState:
            _eq.ChangeCosmeticState();
            break;

        case ItemActionType.MallBuy:
            _eq.TryToMallBuy();
            break;

        case ItemActionType.HonorMallBuy:
            _eq.TryToHonorMallBuy();
            break;

        case ItemActionType.StoreBuy:
            _eq.TryToStoreBuy();
            break;

        case ItemActionType.CityShopBuy:
            _eq.TryToCityStoreBuy();
            break;

        case ItemActionType.Redeem:
            _eq.TryToRedeem();
            break;

        case ItemActionType.PutInStorage:
            _eq.TryToPutInStorage();
            break;

        case ItemActionType.TakeOutStorage:
            _eq.TryTakeOutStorage();
            break;

        case ItemActionType.SelectAdd:
            _eq.TryToSelect();
            break;

        case ItemActionType.Putaway:
            _eq.TryToPutaway();
            break;

        case ItemActionType.Flaunt:
            _eq.TryToFlaunt();
            break;

        case ItemActionType.TryToDestory:
            _eq.TryToDiscard();
            break;

        case ItemActionType.Inlay:
            _eq.TryToInlay();
            break;

        case ItemActionType.Synthetic:
            _eq.TryToOpenSynthetic();
            break;

        case ItemActionType.UnInlay:
            _eq.TryToUnInlay();
            break;

        case ItemActionType.Trade:
            _eq.TryToTrade();
            break;

        case ItemActionType.ToForever:
            _eq.TryToForever();
            break;

        case ItemActionType.BLESSING:
            _eq.TryToBless();
            break;

        case ItemActionType.TAKEOUT:
            _eq.TryToTakeOut();
            break;

        case ItemActionType.MIX:
            _eq.TryToMix();
            break;

        default:
            _eq.TryToDefault();
            break;
        }
    }