|
|
|
using System.Collections.Generic;
|
using System.Linq;
|
|
public partial class HeroInfo
|
{
|
// 羁绊配置
|
public HeroFetterConfig fetterConfig;
|
|
|
public List<int> GetActiveFetter(HeroConfig config, TeamBase teamBase)
|
{
|
List<int> list = new List<int>();
|
if (config.FetterIDList.Length == 0)
|
return list;
|
|
foreach (var fetterID in config.FetterIDList)
|
{
|
HeroFetterConfig fetterConfig = HeroFetterConfig.Get(fetterID);
|
int count = 0;
|
for (int i = 0; i < teamBase.tempHeroes.Length; i++)
|
{
|
TeamHero teamHero = teamBase.tempHeroes[i];
|
|
if (null == teamHero)
|
continue;
|
|
if (fetterConfig.HeroIDList.Contains(teamHero.heroId))
|
{
|
count++;
|
}
|
if (count >= fetterConfig.HeroIDList.Length)
|
{
|
list.Add(fetterID);
|
break;
|
}
|
}
|
}
|
|
return list;
|
}
|
}
|