From 9809d7d0737e1eea547842c2e6b9d95e6868675a Mon Sep 17 00:00:00 2001
From: client_Wu Xijin <364452445@qq.com>
Date: 星期二, 21 八月 2018 09:35:08 +0800
Subject: [PATCH] Merge branch 'master' into DogzDungeon

---
 System/Compose/New/ComposeWinModel.cs |   38 ++++++++++++++++++++++++++++++++------
 1 files changed, 32 insertions(+), 6 deletions(-)

diff --git a/System/Compose/New/ComposeWinModel.cs b/System/Compose/New/ComposeWinModel.cs
index 4cfa451..3e7dc17 100644
--- a/System/Compose/New/ComposeWinModel.cs
+++ b/System/Compose/New/ComposeWinModel.cs
@@ -130,6 +130,24 @@
         return modellist;
     }
 
+    public int GetTicketId(int firstType, int secondType, int thirdType)
+    {
+        var itemId = 0;
+        var dict = ItemCompoundConfig.GetFirstComposeTypeDict(firstType);
+        Dictionary<int, List<ItemCompoundConfig>> _secondTypeDict = null;
+        dict.TryGetValue(secondType, out _secondTypeDict);
+        if (_secondTypeDict != null)
+        {
+            List<ItemCompoundConfig> modellist = null;
+            _secondTypeDict.TryGetValue(thirdType, out modellist);
+            if (modellist != null && modellist.Count > 0)
+            {
+                int.TryParse(modellist[0].makeID, out itemId);
+            }
+        }
+        return itemId;
+    }
+
     public int[] makeIDs { get; private set; }
     public int[] unfixedItemIDs { get; private set; }
     public int[] costfixedItemIDs { get; private set; }
@@ -746,28 +764,36 @@
     {
         bool isEnough = true;
         Dictionary<int, Dictionary<int, List<ItemCompoundConfig>>> getFirstModel = ItemCompoundConfig.GetFirstComposeTypeDict((int)ComposeFuncType.Ticket);
-        if(getFirstModel.ContainsKey(secondType))
+        if (getFirstModel.ContainsKey(secondType))
         {
-            if(getFirstModel[secondType].ContainsKey(0))
+            if (getFirstModel[secondType].ContainsKey(0))
             {
                 ItemCompoundConfig compoundConfig = getFirstModel[secondType][0][0];
                 int[] fixedIDs = ConfigParse.GetMultipleStr<int>(compoundConfig.itemID);
                 int[] fixedCnt = ConfigParse.GetMultipleStr<int>(compoundConfig.itemCount);
-                for(int i= 0; i< fixedIDs.Length; i++)
+                for (int i = 0; i < fixedIDs.Length; i++)
                 {
-                    int haveCnt = playerPack.GetItemCountByID(PackType.rptItem,fixedIDs[i]);
-                    if(fixedCnt[i] > haveCnt)
+                    int haveCnt = playerPack.GetItemCountByID(PackType.rptItem, fixedIDs[i]);
+                    if (fixedCnt[i] > haveCnt)
                     {
                         isEnough = false;
                         break;
                     }
                 }
             }
+            else
+            {
+                isEnough = false;
+            }
+        }
+        else
+        {
+            isEnough = false;
         }
         return isEnough;
     }
 
-     #region 澶勭悊璺宠浆鐣岄潰鏁版嵁
+    #region 澶勭悊璺宠浆鐣岄潰鏁版嵁
 
     public bool CheckComposeItemById(int itemId)
     {

--
Gitblit v1.8.0