From eecfe1ac89223394753b44e0447da2c6c23b0210 Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期六, 23 八月 2025 02:09:20 +0800
Subject: [PATCH] 153 【武将】招募系统

---
 Main/System/HeroUI/HeroUIManager.cs |   57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 57 insertions(+), 0 deletions(-)

diff --git a/Main/System/HeroUI/HeroUIManager.cs b/Main/System/HeroUI/HeroUIManager.cs
index 6f16674..8a73894 100644
--- a/Main/System/HeroUI/HeroUIManager.cs
+++ b/Main/System/HeroUI/HeroUIManager.cs
@@ -213,6 +213,10 @@
     public int selectCallIndex;//0锛�1鎶� 1锛�10鎶� 瀵瑰簲閰嶇疆椤哄簭
     public const string skipKey = "SkipHeroCall";
 
+    //绉垎鎷涘嫙棰勮
+    public List<int> heroCallSortList { get; private set; } = new List<int>();  //绉垎鎷涘嫙鍒楄〃 
+    public int selectHeroCallListJob = 0;    //绛涢�夎亴涓�
+    public int selectHeroCallListCountry = 0;    //绛涢�夊浗瀹�
 
     public bool IsNewHero(int heroID)
     {
@@ -239,6 +243,59 @@
 
         return true;
     }
+
+    List<int> allHeroCallScoreList = new List<int>();  //绉垎鎷涘嫙鍒楄〃 
+    public void SortHeroCallList()
+    {
+        if (allHeroCallScoreList.IsNullOrEmpty())
+        { 
+            allHeroCallScoreList = HappyXBModel.Instance.GetAllGridLibItemIDByType((int)HappXBTitle.HeroCallScore);
+        }
+        heroCallSortList = new List<int>();
+        if (selectHeroCallListJob == 0 && selectHeroCallListCountry == 0)
+        {
+            heroCallSortList = allHeroCallScoreList;
+        }
+        else
+        {
+            foreach (var item in allHeroCallScoreList)
+            {
+                HeroConfig heroConfig = HeroConfig.Get(item);
+                if (heroConfig == null)
+                {
+                    continue;
+                }
+                if (selectHeroCallListJob != 0 && selectHeroCallListJob != heroConfig.Class)
+                {
+                    continue;
+                }
+                if (selectHeroCallListCountry != 0 && selectHeroCallListCountry != heroConfig.Country)
+                {
+                    continue;
+                }
+                heroCallSortList.Add(item);
+            }
+        }
+
+        heroCallSortList.Sort(CmpHeroID);
+    }
+
+    int CmpHeroID(int idA, int idB)
+    {
+        HeroConfig heroA = HeroConfig.Get(idA);
+        HeroConfig heroB = HeroConfig.Get(idB);
+
+
+        // 鎺掑簭瑙勫垯锛氭灏嗗搧璐紴姝﹀皢ID
+        if (heroA.Quality != heroB.Quality)
+        {
+            return heroA.Quality > heroB.Quality ? -1 : 1;
+        }
+
+
+        return heroA.HeroID.CompareTo(heroB.HeroID);
+    }
+
     #endregion
 
 

--
Gitblit v1.8.0