yyl
2025-06-17 007fbd542c30f5fa8308128aac26ce6584b3067a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
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;
    // }
 
}