From 39001a600fcae2bcf27c225df8752d75fb92fef4 Mon Sep 17 00:00:00 2001
From: yyl <yyl>
Date: 星期五, 31 十月 2025 11:18:26 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.1.20:10010/r/Project_SG_scripts

---
 Main/System/KnapSack/Logic/SinglePack.cs |   69 +++++++++++++++++++---------------
 1 files changed, 39 insertions(+), 30 deletions(-)

diff --git a/Main/System/KnapSack/Logic/SinglePack.cs b/Main/System/KnapSack/Logic/SinglePack.cs
index c597917..5765d52 100644
--- a/Main/System/KnapSack/Logic/SinglePack.cs
+++ b/Main/System/KnapSack/Logic/SinglePack.cs
@@ -1,7 +1,5 @@
-锘縰sing System;
-using System.Collections.Generic;
+锘縰sing System.Collections.Generic;
 using System.Linq;
-using System.Text;
 
 public class SinglePack
 {
@@ -9,6 +7,9 @@
     public int unlockedGridCount { get; private set; }  //宸插紑鍚儗鍖呮牸瀛愭暟
     private Dictionary<int, ItemModel> items = new Dictionary<int, ItemModel>(); //key 鐗╁搧浣嶇疆绱㈠紩
     private Dictionary<int, List<int>> itemIDs = new Dictionary<int, List<int>>(); //key 鐗╁搧ID锛氱墿鍝佷綅缃储寮�
+
+    public List<string> itemGuidList = new List<string>();  //鍓嶇鐣岄潰GUID鎺掑簭锛屽悇涓儗鍖呮牴鎹疄闄呮儏鍐典娇鐢�
+
     public SinglePack(PackType type)
     {
         this.type = type;
@@ -181,21 +182,32 @@
         return list;
     }
 
-    public int GetCountById(int itemId, bool includeAuction = true)
+    public List<string> GetItemGUIDListById(int itemId)
     {
-        var count = 0;
-        //foreach (var item in items.Values)
-        //{
-        //    if (!includeAuction && item.isAuction)
-        //    {
-        //        continue;
-        //    }
+        var list = new List<string>();
+        if (itemIDs.ContainsKey(itemId))
+        {
+            foreach (var index in itemIDs[itemId])
+            {
+                var item = items[index];
+                list.Add(item.guid);
+            }
+        }
+        return list;
+    }
 
-        //    if (item.itemId == itemId)
-        //    {
-        //        count += item.count;
-        //    }
-        //}
+
+
+    public long GetCountById(int itemId, bool includeAuction = true)
+    {
+        long count = 0;
+
+        //閮ㄥ垎璐у竵鍜岀墿鍝佺粦瀹�
+        if (GeneralDefine.itemMoneyCountDict.ContainsKey(itemId))
+        {
+            //灞曠ず璐у竵鏁伴噺鐨勭墿鍝�
+            count = UIHelper.GetMoneyCnt(GeneralDefine.itemMoneyCountDict[itemId]);
+        }
 
         if (itemIDs.ContainsKey(itemId))
         {
@@ -212,6 +224,16 @@
         return count;
     }
 
+    public List<ItemModel> GetItems()
+    {
+        return items.Values.ToList();
+    }
+
+    public List<int> GetItemIndexs()
+    {
+        return items.Keys.ToList();
+    }
+    
     public List<ItemModel> GetItems(FilterParams filterParams)
     {
         var list = new List<ItemModel>();
@@ -243,18 +265,6 @@
 
             var jobValid = filterParams.jobs == null || filterParams.jobs.Contains(item.config.JobLimit);
             if (!jobValid)
-            {
-                continue;
-            }
-
-            //var auctionValid = filterParams.isAuction == item.isAuction;
-            //if (!auctionValid)
-            //{
-            //    continue;
-            //}
-
-            var realmValid = filterParams.realmLimit == 0 || filterParams.realmLimit == item.config.RealmLimit;
-            if (!realmValid)
             {
                 continue;
             }
@@ -370,13 +380,12 @@
         itemIDs.Clear();
     }
 
-    public struct FilterParams
+    public class FilterParams
     {
         public List<int> levels;
         public List<int> qualitys;
         public List<int> itemTypes;
         public List<int> equipTypes;
-        public int realmLimit;
         public bool isAuction;
         public List<int> jobs;
     }

--
Gitblit v1.8.0