| | |
| | | } |
| | | |
| | | |
| | | //遣散获取符合条件的武将列表 |
| | | /// 参数: 职业,国家,伤害类型,6大战斗属性,特殊属性 |
| | | public List<string> GetHeroGuidListDelectFunc(List<int> selectList = null) |
| | | { |
| | | var _list = HeroManager.Instance.GetHeroList(); |
| | | if (selectList.IsNullOrEmpty()) |
| | | return HeroManager.Instance.GetHeroGuidList(); |
| | | |
| | | int job = selectList[0]; |
| | | int country = selectList[1]; |
| | | int hurtType = selectList[2]; |
| | | int fightAttrType = selectList[3]; |
| | | int specialAttrType = selectList[4]; |
| | | |
| | | List<string> retGuidList = new List<string>(); |
| | | foreach (var heroInfo in _list) |
| | | { |
| | | |
| | | if (heroInfo.isAttrActive) |
| | | continue; |
| | | |
| | | if (heroInfo.heroStar < heroInfo.GetCurMaxStar()) |
| | | { |
| | | continue; |
| | | } |
| | | |
| | | //0代表全部, 同级别是可复选,不同级别为且的关系 |
| | | bool isMatch = true; |
| | | if (job != 0) |
| | | { |
| | | isMatch = isMatch && (job & (1 << heroInfo.heroConfig.Class)) > 0; |
| | | } |
| | | if (country != 0) |
| | | { |
| | | isMatch = isMatch && (country & (1 << heroInfo.heroConfig.Country)) > 0; |
| | | } |
| | | if (hurtType != 0) |
| | | { |
| | | isMatch = isMatch && (hurtType & (1 << heroInfo.heroConfig.HurtType)) > 0; |
| | | } |
| | | if (fightAttrType != 0) |
| | | { |
| | | isMatch = isMatch && (fightAttrType & (1 << heroInfo.heroConfig.Specialty)) > 0; |
| | | } |
| | | if (specialAttrType != 0) |
| | | { |
| | | bool isMatch2 = false; |
| | | for (int i = 0; i < heroInfo.heroConfig.Specialty2.Length; i++) |
| | | { |
| | | isMatch2 = (specialAttrType & (1 << heroInfo.heroConfig.Specialty2[i])) > 0; |
| | | if (isMatch2) |
| | | break; |
| | | } |
| | | isMatch = isMatch && isMatch2; |
| | | } |
| | | if (isMatch) |
| | | { |
| | | retGuidList.Add(heroInfo.itemHero.guid); |
| | | } |
| | | |
| | | } |
| | | return retGuidList; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | public void SortHeroDeleteList() |
| | | { |
| | | heroDeleteSortList = HeroManager.Instance.GetHeroGuidList(selectHeroDeleteList); |
| | | heroDeleteSortList = GetHeroGuidListDelectFunc(selectHeroDeleteList); |
| | | heroDeleteSortList.Sort(CmpDeleteHero); |
| | | } |
| | | |