using System.Collections.Generic;
|
using UnityEngine;
|
|
public class HeroManager : GameSystemManager<HeroManager>
|
{
|
protected Dictionary<long, HeroInfo> heroInfoDict = new Dictionary<long, HeroInfo>();
|
|
public override void Init()
|
{
|
base.Init();
|
|
// 注册一点事件
|
}
|
|
public override void Release()
|
{
|
base.Release();
|
}
|
|
public override void RequestNessaryData()
|
{
|
base.RequestNessaryData();
|
|
|
}
|
|
public void UpdateHeroInfo()
|
{
|
|
}
|
|
public List<HeroInfo> GetPowerfulHeroList()
|
{
|
List<HeroInfo> heroList = new List<HeroInfo>(heroInfoDict.Values);
|
|
heroList.Sort((a, b) =>
|
{
|
int power1 = a.CalculatePower();
|
int power2 = b.CalculatePower();
|
|
if (power1 == power2)
|
{
|
return 0;
|
}
|
|
return power1 > power2 ? -1 : 1;
|
});
|
|
List<HeroInfo> retList = new List<HeroInfo>();
|
|
for (int i = 0; i < TeamConst.MaxTeamHeroCount && i < heroList.Count; i++)
|
{
|
retList.Add(heroList[i]);
|
}
|
|
return retList;
|
}
|
|
// public override bool IsNessaryDataReady()
|
// {
|
// return true;
|
// }
|
|
}
|