From 5c5a5cc66227439be7a7b61da5d1ff68cf187ac3 Mon Sep 17 00:00:00 2001 From: hch <305670599@qq.com> Date: 星期一, 18 八月 2025 22:47:05 +0800 Subject: [PATCH] 117 【武将】武将系统 - 战力计算 --- Main/System/Team/TeamBase.cs | 24 +++++++++++++----------- 1 files changed, 13 insertions(+), 11 deletions(-) diff --git a/Main/System/Team/TeamBase.cs b/Main/System/Team/TeamBase.cs index f578df0..30933ec 100644 --- a/Main/System/Team/TeamBase.cs +++ b/Main/System/Team/TeamBase.cs @@ -226,6 +226,18 @@ return false; } + public bool HasHeroInServer(string guid) + { + foreach (var hero in serverHeroes) + { + if (hero != null && hero.guid == guid) + { + return true; + } + } + return false; + } + //瀹㈡埛绔粠0寮�濮嬶紝鏈嶅姟绔粠1寮�濮� public int GetEmptyPosition() { @@ -270,17 +282,7 @@ return; } - TeamHero targetHero = tempHeroes[targetPosition]; - - if (null == targetHero) - { - TeamHero newHero = new TeamHero(heroInfo, targetPosition, this); - SetTeamHero(targetPosition, newHero); - } - else - { - SetTeamHero(targetPosition, new TeamHero(heroInfo, targetPosition, this)); - } + SetTeamHero(targetPosition, new TeamHero(heroInfo, targetPosition, this)); } -- Gitblit v1.8.0