| | |
| | | //初始创建(0725),后续跟随背包事件增加删除 key = guid |
| | | protected Dictionary<string, HeroInfo> heroInfoDict = new Dictionary<string, HeroInfo>(); |
| | | |
| | | |
| | | |
| | | //武将红点 |
| | | //MainRedDot.HeroCardRedpoint * 1000 + hero.itemHero.gridIndex; |
| | | |
| | | public Action<HeroInfo> onNewHeroEvent; |
| | | |
| | | public Action<HeroInfo> onHeroChangeEvent; |
| | | |
| | | public Action<HeroInfo> onHeroDeleteEvent; |
| | | public Action<int> onHeroDeleteEvent; |
| | | |
| | | public override void Init() |
| | | { |
| | |
| | | |
| | | heroInfoDict.Remove(guid); |
| | | |
| | | if (null != heroInfo) |
| | | onHeroDeleteEvent?.Invoke(heroInfo); |
| | | onHeroDeleteEvent?.Invoke(itemID); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | heroList.Sort((a, b) => |
| | | { |
| | | int power1 = a.CalculatePower(); |
| | | int power2 = b.CalculatePower(); |
| | | long power1 = a.CalculatePower(false); |
| | | long power2 = b.CalculatePower(false); |
| | | |
| | | if (power1 == power2) |
| | | { |
| | |
| | | { |
| | | return PackManager.Instance.GetSinglePack(PackType.Hero).HasItem(heroID); |
| | | } |
| | | |
| | | public int GetHeroCountByID(int heroID) |
| | | { |
| | | return (int)PackManager.Instance.GetSinglePack(PackType.Hero).GetCountById(heroID); |
| | | } |
| | | } |