少年修仙传客户端代码仓库
client_Wu Xijin
2018-11-08 ddaa4e2f9ba1c56485e305c335408e072cafc53c
System/Compose/New/ComposeWinModel.cs
@@ -186,6 +186,7 @@
    {
        public int thirdType;
        public ItemCompoundConfig itemCompound = null;
    }
    #endregion
@@ -298,6 +299,66 @@
        indexlist = singlePack.ItemIndexlist(increases[0], increases[1]);
        return true;
    }
    public bool TryGetCountById(NeedMatType matType,ItemCompoundConfig itemCompound,int itemId,out int itemCount)
    {
        itemCount = 0;
        if (itemCompound == null || itemId == 0) return false;
        switch (matType)
        {
            case NeedMatType.IncreaseItem:
                int[] increases = itemCompound.successRateIncrease;
                if (increases != null && increases.Length >= 3)
                {
                    itemCount = increases[1];
                    return true;
                }
                break;
            case NeedMatType.fixedItem:
                int[] fixedIds = itemCompound.itemID;
                int[] fixedCounts = itemCompound.itemCount;
                int[] fixedDisplays = itemCompound.itemDisplay;
                if (fixedIds != null)
                {
                    for (int i = 0; i < fixedIds.Length; i++)
                    {
                        if (fixedIds[i] == itemId)
                        {
                            itemCount = fixedCounts[i];
                            return true;
                        }
                    }
                }
                break;
        }
        return false;
    }
    public bool TryGetIdByDisplay(NeedMatType matType, ItemCompoundConfig itemCompound, int display, out int itemId)
    {
        itemId = 0;
        if (itemCompound == null || display == 0) return false;
        switch (matType)
        {
            case NeedMatType.fixedItem:
                int[] fixedIds = itemCompound.itemID;
                int[] fixedDisplays = itemCompound.itemDisplay;
                if (fixedDisplays != null)
                {
                    for (int i = 0; i < fixedDisplays.Length; i++)
                    {
                        if (fixedDisplays[i] == display)
                        {
                            itemId = fixedIds[i];
                            return true;
                        }
                    }
                }
                break;
        }
        return false;
    }
    #endregion
    public bool IsComposeJobLimit(int composeId)