From ab82a71eab5f13795876b913b7423fb3e6a4f374 Mon Sep 17 00:00:00 2001
From: lcy <1459594991@qq.com>
Date: 星期一, 20 十月 2025 19:44:29 +0800
Subject: [PATCH] 143 演武场-客户端 战斗支持显示国家武将数量及点击展示详情,修复层级
---
Main/System/HeroUI/HeroUIManager.OnTeam.cs | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 51 insertions(+), 0 deletions(-)
diff --git a/Main/System/HeroUI/HeroUIManager.OnTeam.cs b/Main/System/HeroUI/HeroUIManager.OnTeam.cs
index f0a9734..00ec094 100644
--- a/Main/System/HeroUI/HeroUIManager.OnTeam.cs
+++ b/Main/System/HeroUI/HeroUIManager.OnTeam.cs
@@ -198,6 +198,37 @@
}
/// <summary>
+ /// 鑾峰緱鑷畾涔夐槦浼嶄腑鍚勪釜鍥藉鐨勬灏嗘暟閲�
+ /// </summary>
+ public Dictionary<HeroCountry, int> GetCountryHeroCountByTeamHeroList(List<TeamHero> teamHeroes)
+ {
+ Dictionary<HeroCountry, int> heroCountryCount = new Dictionary<HeroCountry, int>();
+ if (teamHeroes == null)
+ {
+ return heroCountryCount;
+ }
+ for (int i = 0; i < teamHeroes.Count; i++)
+ {
+ if (teamHeroes[i] == null)
+ continue;
+ var country = teamHeroes[i].Country;
+
+ if (!heroCountryCount.ContainsKey(country))
+ {
+ heroCountryCount.Add(country, 1);
+ }
+ else
+ {
+ heroCountryCount[country] += 1;
+ }
+
+ }
+
+
+ return heroCountryCount;
+ }
+
+ /// <summary>
/// 鑾峰緱涓婇樀涓灏嗘暟閲忔渶澶х殑鍥藉鍜屾暟閲�
/// </summary>
/// <param name="teamType"></param>
@@ -220,6 +251,26 @@
return new Int2((int)country, maxValue);
}
+ /// <summary>
+ /// 鑾峰緱鑷畾涔夐槦浼嶄腑姝﹀皢鏁伴噺鏈�澶х殑鍥藉鍜屾暟閲�
+ /// </summary>
+ public Int2 GetMaxCountHeroCountry(List<TeamHero> teamType)
+ {
+ var countryCountDict = GetCountryHeroCountByTeamHeroList(teamType);
+ //鎵惧埌鏈�澶х殑鍥藉鍜屾暟閲�
+ HeroCountry country = HeroCountry.None;
+ int maxValue = 0;
+ foreach (var data in countryCountDict)
+ {
+ if (data.Value > maxValue)
+ {
+ country = data.Key;
+ maxValue = data.Value;
+ }
+ }
+ return new Int2((int)country, maxValue);
+ }
+
//鍦ㄤ笉鍚岄〉绛句笅閫堿ttackType 0 鏀诲嚮闃靛 1 闃插畧闃靛
public int GetSelectTeamTypeByAttackType(int AttackType)
{
--
Gitblit v1.8.0