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 |   63 ++++++++++++++++++-------------
 1 files changed, 36 insertions(+), 27 deletions(-)

diff --git a/Main/System/KnapSack/Logic/SinglePack.cs b/Main/System/KnapSack/Logic/SinglePack.cs
index 36f22b3..5765d52 100644
--- a/Main/System/KnapSack/Logic/SinglePack.cs
+++ b/Main/System/KnapSack/Logic/SinglePack.cs
@@ -1,4 +1,5 @@
 锘縰sing System.Collections.Generic;
+using System.Linq;
 
 public class SinglePack
 {
@@ -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