| | |
| | | //初始创建(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() |
| | | { |
| | |
| | | } |
| | | } |
| | | |
| | | void DeleteHero(PackType packType, string guid) |
| | | void DeleteHero(PackType packType, string guid, int itemID, int index, int clearType) |
| | | { |
| | | if (packType == PackType.Hero) |
| | | { |
| | |
| | | |
| | | 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.CalculateFightPower(false); |
| | | long power2 = b.CalculateFightPower(false); |
| | | |
| | | if (power1 == power2) |
| | | { |
| | |
| | | |
| | | |
| | | public int GetHeroCount() |
| | | { |
| | | { |
| | | return heroInfoDict.Count; |
| | | } |
| | | |
| | | public bool HasHero(int heroID) |
| | | { |
| | | return PackManager.Instance.GetSinglePack(PackType.Hero).HasItem(heroID); |
| | | } |
| | | |
| | | public int GetHeroCountByID(int heroID) |
| | | { |
| | | return (int)PackManager.Instance.GetSinglePack(PackType.Hero).GetCountById(heroID); |
| | | } |
| | | } |