10060 所有战令统一索引跳转逻辑,有可领取的跳到可领取的,没有可领取的跳到下一个可领取的
| | |
| | | //获取最小未领取的物品索引
|
| | | public int GetJumpStartIndex(int zhanLingType)
|
| | | {
|
| | | int nowNeedValue = ModelCenter.Instance.GetModel<SkyTowerModel>().highestPassFloor;
|
| | | List<int> zhanLingLvList = ILZhanlingConfig.GetTypeToIDDict(zhanLingType).Keys.ToList();
|
| | | int maxNeedValue = ILZhanlingConfig.GetTypeToIDDict(zhanLingType).Keys.ToList()[0];
|
| | | for (int i = 0; i < zhanLingLvList.Count; i++)
|
| | | var infoDict = ILZhanlingConfig.GetTypeToIDDict(zhanLingType);
|
| | | if (infoDict.IsNullOrEmpty())
|
| | | return 0;
|
| | |
|
| | | List<int> infoList = infoDict.Keys.ToList();
|
| | | if (infoList.IsNullOrEmpty())
|
| | | return 0;
|
| | |
|
| | | if (zhanLingInfoDict.IsNullOrEmpty() || !zhanLingInfoDict.ContainsKey(zhanLingType))
|
| | | return 0;
|
| | |
|
| | | var zhanLingInfo = zhanLingInfoDict[zhanLingType];
|
| | |
|
| | | int index = 0;
|
| | | bool allItemsClaimed = true;
|
| | |
|
| | | for (int i = 0; i < infoList.Count; i++)
|
| | | {
|
| | | if (nowNeedValue >= zhanLingLvList[i])
|
| | | int needValue = infoList[i];
|
| | | bool isHaveFree = zhanLingInfo.freeZhanHaveDict.GetValueOrDefault(needValue, 0) > 0;
|
| | | bool isHavePaid = zhanLingInfo.paidZhanHaveDict.GetValueOrDefault(needValue, 0) > 0;
|
| | |
|
| | | if (!isHaveFree || !isHavePaid)
|
| | | {
|
| | | if (zhanLingInfoDict[zhanLingType].isActivite > 0)
|
| | | allItemsClaimed = false;
|
| | | if (!isHaveFree)
|
| | | {
|
| | | if (!IsHaveZhanLingGift(zhanLingType, zhanLingLvList[i], false) || !IsHaveZhanLingGift(zhanLingType, zhanLingLvList[i], true))
|
| | | {
|
| | | maxNeedValue = zhanLingLvList[i];
|
| | | break;
|
| | | }
|
| | | index = i;
|
| | | break;
|
| | | }
|
| | | else
|
| | |
|
| | | if (zhanLingInfo.isActivite > 0 && !isHavePaid)
|
| | | {
|
| | | if (!IsHaveZhanLingGift(zhanLingType, zhanLingLvList[i], true))
|
| | | {
|
| | | maxNeedValue = zhanLingLvList[i];
|
| | | break;
|
| | | }
|
| | | index = i;
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | | var needValueList = ILZhanlingConfig.GetTypeToIDDict(zhanLingType).Keys.ToList();
|
| | | int startIndex = needValueList.IndexOf(maxNeedValue);
|
| | | return Math.Max(0, startIndex);
|
| | |
|
| | | if (allItemsClaimed && zhanLingInfo.isActivite > 0)
|
| | | {
|
| | | return infoList.Count - 1;
|
| | | }
|
| | |
|
| | | return Math.Max(0, index - 2);
|
| | | }
|
| | |
|
| | |
|
| | |
| | | //获取最小未领取的物品索引
|
| | | public int GetJumpStartIndex(int zhanLingType)
|
| | | {
|
| | | int nowNeedValue = GetAllGuBaoStarCount();
|
| | | List<int> zhanLingLvList = ILZhanlingConfig.GetTypeToIDDict(zhanLingType).Keys.ToList();
|
| | | int maxNeedValue = ILZhanlingConfig.GetTypeToIDDict(zhanLingType).Keys.ToList()[0];
|
| | | for (int i = 0; i < zhanLingLvList.Count; i++)
|
| | | var infoDict = ILZhanlingConfig.GetTypeToIDDict(zhanLingType);
|
| | | if (infoDict.IsNullOrEmpty())
|
| | | return 0;
|
| | |
|
| | | List<int> infoList = infoDict.Keys.ToList();
|
| | | if (infoList.IsNullOrEmpty())
|
| | | return 0;
|
| | |
|
| | | if (zhanLingInfoDict.IsNullOrEmpty() || !zhanLingInfoDict.ContainsKey(zhanLingType))
|
| | | return 0;
|
| | |
|
| | | var zhanLingInfo = zhanLingInfoDict[zhanLingType];
|
| | |
|
| | | int index = 0;
|
| | | bool allItemsClaimed = true;
|
| | |
|
| | | for (int i = 0; i < infoList.Count; i++)
|
| | | {
|
| | | if (nowNeedValue >= zhanLingLvList[i])
|
| | | int needValue = infoList[i];
|
| | | bool isHaveFree = zhanLingInfo.freeZhanHaveDict.GetValueOrDefault(needValue, 0) > 0;
|
| | | bool isHavePaid = zhanLingInfo.paidZhanHaveDict.GetValueOrDefault(needValue, 0) > 0;
|
| | |
|
| | | if (!isHaveFree || !isHavePaid)
|
| | | {
|
| | | if (zhanLingInfoDict[zhanLingType].isActivite > 0)
|
| | | allItemsClaimed = false;
|
| | | if (!isHaveFree)
|
| | | {
|
| | | if (!IsHaveZhanLingGift(zhanLingType, zhanLingLvList[i], false) || !IsHaveZhanLingGift(zhanLingType, zhanLingLvList[i], true))
|
| | | {
|
| | | maxNeedValue = zhanLingLvList[i];
|
| | | break;
|
| | | }
|
| | | index = i;
|
| | | break;
|
| | | }
|
| | | else
|
| | |
|
| | | if (zhanLingInfo.isActivite > 0 && !isHavePaid)
|
| | | {
|
| | | if (!IsHaveZhanLingGift(zhanLingType, zhanLingLvList[i], true))
|
| | | {
|
| | | maxNeedValue = zhanLingLvList[i];
|
| | | break;
|
| | | }
|
| | | index = i;
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | | var needValueList = ILZhanlingConfig.GetTypeToIDDict(zhanLingType).Keys.ToList();
|
| | | int startIndex = needValueList.IndexOf(maxNeedValue);
|
| | | return Math.Max(0, startIndex);
|
| | |
|
| | | if (allItemsClaimed && zhanLingInfo.isActivite > 0)
|
| | | {
|
| | | return infoList.Count - 1;
|
| | | }
|
| | |
|
| | | return Math.Max(0, index - 2);
|
| | | }
|
| | |
|
| | | //一键获取所有可领取的礼品,弹出展示窗口
|
| | |
| | | {
|
| | | return isFreeGift ? ILZhanlingConfig.Get(typeToIDListDict[zhanLingType][needValue]).FreeRewardItemList[0][1] : ILZhanlingConfig.Get(typeToIDListDict[zhanLingType][needValue]).ZLRewardItemList[loopIndedx][1];
|
| | | }
|
| | |
|
| | | //获取最小未领取的物品索引
|
| | | public int GetJumpStartIndex(int zhanLingType)
|
| | | {
|
| | | int nowNeedValue = PlayerDatas.Instance.baseData.LV;
|
| | | List<int> zhanLingLvList = ILZhanlingConfig.GetTypeToIDDict(zhanLingType).Keys.ToList();
|
| | | int maxNeedValue = ILZhanlingConfig.GetTypeToIDDict(zhanLingType).Keys.ToList()[0];
|
| | | for (int i = 0; i < zhanLingLvList.Count; i++)
|
| | | var infoDict = ILZhanlingConfig.GetTypeToIDDict(zhanLingType);
|
| | | if (infoDict.IsNullOrEmpty())
|
| | | return 0;
|
| | |
|
| | | List<int> infoList = infoDict.Keys.ToList();
|
| | | if (infoList.IsNullOrEmpty())
|
| | | return 0;
|
| | |
|
| | | if (zhanLingInfoDict.IsNullOrEmpty() || !zhanLingInfoDict.ContainsKey(zhanLingType))
|
| | | return 0;
|
| | |
|
| | | var zhanLingInfo = zhanLingInfoDict[zhanLingType];
|
| | |
|
| | | int index = 0;
|
| | | bool allItemsClaimed = true;
|
| | |
|
| | | for (int i = 0; i < infoList.Count; i++)
|
| | | {
|
| | | if (nowNeedValue >= zhanLingLvList[i])
|
| | | int needValue = infoList[i];
|
| | | bool isHaveFree = zhanLingInfo.freeZhanHaveDict.GetValueOrDefault(needValue, 0) > 0;
|
| | | bool isHavePaid = zhanLingInfo.paidZhanHaveDict.GetValueOrDefault(needValue, 0) > 0;
|
| | |
|
| | | if (!isHaveFree || !isHavePaid)
|
| | | {
|
| | | if (zhanLingInfoDict[zhanLingType].isActivite > 0)
|
| | | allItemsClaimed = false;
|
| | | if (!isHaveFree)
|
| | | {
|
| | | if (!IsHaveZhanLingGift(zhanLingType, zhanLingLvList[i], false) || !IsHaveZhanLingGift(zhanLingType, zhanLingLvList[i], true))
|
| | | {
|
| | | maxNeedValue = zhanLingLvList[i];
|
| | | break;
|
| | | }
|
| | | index = i;
|
| | | break;
|
| | | }
|
| | | else
|
| | |
|
| | | if (zhanLingInfo.isActivite > 0 && !isHavePaid)
|
| | | {
|
| | | if (!IsHaveZhanLingGift(zhanLingType, zhanLingLvList[i], true))
|
| | | {
|
| | | maxNeedValue = zhanLingLvList[i];
|
| | | break;
|
| | | }
|
| | | index = i;
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | | return Math.Max(0, ILZhanlingConfig.GetTypeToIDDict(zhanLingType)[maxNeedValue] - 1);
|
| | | }
|
| | |
|
| | | if (allItemsClaimed && zhanLingInfo.isActivite > 0)
|
| | | {
|
| | | return infoList.Count - 1;
|
| | | }
|
| | |
|
| | | return Math.Max(0, index - 2);
|
| | | }
|
| | | //一键获取所有可领取的礼品,弹出展示窗口
|
| | | public void HaveAllZhanLingGift(int zhanLingType)
|
| | | {
|
| | |
| | | //获取最小未领取的物品索引
|
| | | public int GetJumpStartIndex(int zhanLingType)
|
| | | {
|
| | | int nowNeedValue = PlayerDatas.Instance.baseData.realmLevel;
|
| | | List<int> zhanLingLvList = ILZhanlingConfig.GetTypeToIDDict(zhanLingType).Keys.ToList();
|
| | | int maxNeedValue = ILZhanlingConfig.GetTypeToIDDict(zhanLingType).Keys.ToList()[0];
|
| | | for (int i = 0; i < zhanLingLvList.Count; i++)
|
| | | var infoDict = ILZhanlingConfig.GetTypeToIDDict(zhanLingType);
|
| | | if (infoDict.IsNullOrEmpty())
|
| | | return 0;
|
| | |
|
| | | List<int> infoList = infoDict.Keys.ToList();
|
| | | if (infoList.IsNullOrEmpty())
|
| | | return 0;
|
| | |
|
| | | if (zhanLingInfoDict.IsNullOrEmpty() || !zhanLingInfoDict.ContainsKey(zhanLingType))
|
| | | return 0;
|
| | |
|
| | | var zhanLingInfo = zhanLingInfoDict[zhanLingType];
|
| | |
|
| | | int index = 0;
|
| | | bool allItemsClaimed = true;
|
| | |
|
| | | for (int i = 0; i < infoList.Count; i++)
|
| | | {
|
| | | if (nowNeedValue >= zhanLingLvList[i])
|
| | | int needValue = infoList[i];
|
| | | bool isHaveFree = zhanLingInfo.freeZhanHaveDict.GetValueOrDefault(needValue, 0) > 0;
|
| | | bool isHavePaid = zhanLingInfo.paidZhanHaveDict.GetValueOrDefault(needValue, 0) > 0;
|
| | |
|
| | | if (!isHaveFree || !isHavePaid)
|
| | | {
|
| | | if (zhanLingInfoDict[zhanLingType].isActivite > 0)
|
| | | allItemsClaimed = false;
|
| | | if (!isHaveFree)
|
| | | {
|
| | | if (!IsHaveZhanLingGift(zhanLingType, zhanLingLvList[i], false) || !IsHaveZhanLingGift(zhanLingType, zhanLingLvList[i], true))
|
| | | {
|
| | | maxNeedValue = zhanLingLvList[i];
|
| | | break;
|
| | | }
|
| | | index = i;
|
| | | break;
|
| | | }
|
| | | else
|
| | |
|
| | | if (zhanLingInfo.isActivite > 0 && !isHavePaid)
|
| | | {
|
| | | if (!IsHaveZhanLingGift(zhanLingType, zhanLingLvList[i], true))
|
| | | {
|
| | | maxNeedValue = zhanLingLvList[i];
|
| | | break;
|
| | | }
|
| | | index = i;
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | | var needValueList = ILZhanlingConfig.GetTypeToIDDict(zhanLingType).Keys.ToList();
|
| | | int startIndex = needValueList.IndexOf(maxNeedValue);
|
| | | return Math.Max(0, startIndex);
|
| | |
|
| | | if (allItemsClaimed && zhanLingInfo.isActivite > 0)
|
| | | {
|
| | | return infoList.Count - 1;
|
| | | }
|
| | |
|
| | | return Math.Max(0, index - 2);
|
| | | }
|
| | | //一键获取所有可领取的礼品,弹出展示窗口
|
| | | public void HaveAllZhanLingGift(int zhanLingType)
|
| | |
| | | //获取最小未领取的物品索引
|
| | | public int GetJumpStartIndex(int zhanLingType)
|
| | | {
|
| | | int nowNeedValue = (int)GetNowValue();
|
| | | var infoDict = ILZhanlingConfig.GetTypeToIDDict(zhanLingType);
|
| | | if (infoDict.IsNullOrEmpty())
|
| | | return 0;
|
| | |
|
| | | List<int> infoList = infoDict.Keys.ToList();
|
| | | if (infoList.IsNullOrEmpty())
|
| | | return 0;
|
| | |
|
| | | if (zhanLingInfoDict.IsNullOrEmpty() || !zhanLingInfoDict.ContainsKey(zhanLingType))
|
| | | return 0;
|
| | |
|
| | | var zhanLingInfo = zhanLingInfoDict[zhanLingType];
|
| | |
|
| | | int index = 0;
|
| | | bool allItemsClaimed = true;
|
| | |
|
| | | for (int i = 0; i < infoList.Count; i++)
|
| | | {
|
| | | int needValue = infoList[i];
|
| | | //可领取
|
| | | if (nowNeedValue >= needValue)
|
| | | bool isHaveFree = zhanLingInfo.freeZhanHaveDict.GetValueOrDefault(needValue, 0) > 0;
|
| | | bool isHavePaid = zhanLingInfo.paidZhanHaveDict.GetValueOrDefault(needValue, 0) > 0;
|
| | |
|
| | | if (!isHaveFree || !isHavePaid)
|
| | | {
|
| | | if (zhanLingInfoDict[zhanLingType].isActivite > 0)
|
| | | allItemsClaimed = false;
|
| | | if (!isHaveFree)
|
| | | {
|
| | | if (!IsHaveZhanLingGift(zhanLingType, needValue, false) || !IsHaveZhanLingGift(zhanLingType, needValue, true))
|
| | | {
|
| | | index = i;
|
| | | break;
|
| | | }
|
| | | index = i;
|
| | | break;
|
| | | }
|
| | | else
|
| | | {
|
| | | if (!IsHaveZhanLingGift(zhanLingType, needValue, true))
|
| | | {
|
| | | index = i;
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | if (!IsHaveZhanLingGift(zhanLingType, needValue, false) || !IsHaveZhanLingGift(zhanLingType, needValue, true))
|
| | |
|
| | | if (zhanLingInfo.isActivite > 0 && !isHavePaid)
|
| | | {
|
| | | index = i;
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | if (allItemsClaimed && zhanLingInfo.isActivite > 0)
|
| | | {
|
| | | return infoList.Count - 1;
|
| | | }
|
| | |
|
| | | return Math.Max(0, index - 2);
|
| | | }
|
| | |
|
| | |
| | | //获取最小未领取的物品索引
|
| | | public int GetJumpStartIndex(int zhanLingType)
|
| | | {
|
| | | List<int> needValueList = ILZhanlingConfig.GetTypeToIDDict(zhanLingType).Keys.ToList();
|
| | | int maxNeedValue = ILZhanlingConfig.GetTypeToIDDict(zhanLingType).Keys.ToList()[0];
|
| | | for (int i = 0; i < needValueList.Count; i++)
|
| | | var infoDict = ILZhanlingConfig.GetTypeToIDDict(zhanLingType);
|
| | | if (infoDict.IsNullOrEmpty())
|
| | | return 0;
|
| | |
|
| | | List<int> infoList = infoDict.Keys.ToList();
|
| | | if (infoList.IsNullOrEmpty())
|
| | | return 0;
|
| | |
|
| | | if (zhanLingInfoDict.IsNullOrEmpty() || !zhanLingInfoDict.ContainsKey(zhanLingType))
|
| | | return 0;
|
| | |
|
| | | var zhanLingInfo = zhanLingInfoDict[zhanLingType];
|
| | |
|
| | | int index = 0;
|
| | | bool allItemsClaimed = true;
|
| | |
|
| | | for (int i = 0; i < infoList.Count; i++)
|
| | | {
|
| | | if (IsNeedValueOk(needValueList[i]))
|
| | | int needValue = infoList[i];
|
| | | bool isHaveFree = zhanLingInfo.freeZhanHaveDict.GetValueOrDefault(needValue, 0) > 0;
|
| | | bool isHavePaid = zhanLingInfo.paidZhanHaveDict.GetValueOrDefault(needValue, 0) > 0;
|
| | | bool isHavePaidH = zhanLingInfo.paidZhanHaveHDict.GetValueOrDefault(needValue, 0) > 0;
|
| | |
|
| | | if (!isHaveFree || !isHavePaid || !isHavePaidH)
|
| | | {
|
| | | bool isHaveFree = zhanLingInfoDict[zhanLingType].paidZhanHaveDict[needValueList[i]] > 0;
|
| | | bool isHavePaid = zhanLingInfoDict[zhanLingType].paidZhanHaveDict[needValueList[i]] > 0;
|
| | | bool isHavePaidH = zhanLingInfoDict[zhanLingType].paidZhanHaveHDict[needValueList[i]] > 0;
|
| | | if (zhanLingInfoDict[zhanLingType].isActiviteH > 0)
|
| | | allItemsClaimed = false;
|
| | | if (!isHaveFree)
|
| | | {
|
| | | if (!isHaveFree || !isHavePaid || !isHavePaidH)
|
| | | {
|
| | | maxNeedValue = needValueList[i];
|
| | | break;
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | if (zhanLingInfoDict[zhanLingType].isActivite > 0)
|
| | | {
|
| | | if (!isHaveFree || !isHavePaid)
|
| | | {
|
| | | maxNeedValue = needValueList[i];
|
| | | break;
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | if (!isHaveFree)
|
| | | {
|
| | | maxNeedValue = needValueList[i];
|
| | | break;
|
| | | }
|
| | | }
|
| | | index = i;
|
| | | break;
|
| | | }
|
| | |
|
| | | if (zhanLingInfo.isActivite > 0 && !isHavePaid)
|
| | | {
|
| | | index = i;
|
| | | break;
|
| | | }
|
| | |
|
| | | if (zhanLingInfo.isActiviteH > 0 && !isHavePaidH)
|
| | | {
|
| | | index = i;
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | | var temp = ILZhanlingConfig.GetTypeToIDDict(zhanLingType).Keys.ToList();
|
| | | int startIndex = temp.IndexOf(maxNeedValue);
|
| | | return Math.Max(0, startIndex);
|
| | |
|
| | | if (allItemsClaimed && zhanLingInfo.isActivite > 0 && zhanLingInfo.isActiviteH > 0)
|
| | | {
|
| | | return infoList.Count - 1;
|
| | | }
|
| | |
|
| | | return Math.Max(0, index - 2);
|
| | | }
|
| | |
|
| | | //一键获取所有可领取的礼品,弹出展示窗口
|
| | |
| | | //获取最小未领取的物品索引
|
| | | public int GetJumpStartIndex(int zhanLingType)
|
| | | {
|
| | | List<int> needValueList = ILZhanlingConfig.GetTypeToIDDict(zhanLingType).Keys.ToList();
|
| | | int maxNeedValue = ILZhanlingConfig.GetTypeToIDDict(zhanLingType).Keys.ToList()[0];
|
| | | for (int i = 0; i < needValueList.Count; i++)
|
| | | var infoDict = ILZhanlingConfig.GetTypeToIDDict(zhanLingType);
|
| | | if (infoDict.IsNullOrEmpty())
|
| | | return 0;
|
| | |
|
| | | List<int> infoList = infoDict.Keys.ToList();
|
| | | if (infoList.IsNullOrEmpty())
|
| | | return 0;
|
| | |
|
| | | if (zhanLingInfoDict.IsNullOrEmpty() || !zhanLingInfoDict.ContainsKey(zhanLingType))
|
| | | return 0;
|
| | |
|
| | | var zhanLingInfo = zhanLingInfoDict[zhanLingType];
|
| | |
|
| | | int index = 0;
|
| | | bool allItemsClaimed = true;
|
| | |
|
| | | for (int i = 0; i < infoList.Count; i++)
|
| | | {
|
| | | if (IsNeedValueOk(needValueList[i]))
|
| | | int needValue = infoList[i];
|
| | | bool isHaveFree = zhanLingInfo.freeZhanHaveDict.GetValueOrDefault(needValue, 0) > 0;
|
| | | bool isHavePaid = zhanLingInfo.paidZhanHaveDict.GetValueOrDefault(needValue, 0) > 0;
|
| | | bool isHavePaidH = zhanLingInfo.paidZhanHaveHDict.GetValueOrDefault(needValue, 0) > 0;
|
| | |
|
| | | if (!isHaveFree || !isHavePaid || !isHavePaidH)
|
| | | {
|
| | | bool isHaveFree = zhanLingInfoDict[zhanLingType].paidZhanHaveDict[needValueList[i]] > 0;
|
| | | bool isHavePaid = zhanLingInfoDict[zhanLingType].paidZhanHaveDict[needValueList[i]] > 0;
|
| | | bool isHavePaidH = zhanLingInfoDict[zhanLingType].paidZhanHaveHDict[needValueList[i]] > 0;
|
| | | if (zhanLingInfoDict[zhanLingType].isActiviteH > 0)
|
| | | allItemsClaimed = false;
|
| | | if (!isHaveFree)
|
| | | {
|
| | | if (!isHaveFree || !isHavePaid || !isHavePaidH)
|
| | | {
|
| | | maxNeedValue = needValueList[i];
|
| | | break;
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | if (zhanLingInfoDict[zhanLingType].isActivite > 0)
|
| | | {
|
| | | if (!isHaveFree || !isHavePaid)
|
| | | {
|
| | | maxNeedValue = needValueList[i];
|
| | | break;
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | if (!isHaveFree)
|
| | | {
|
| | | maxNeedValue = needValueList[i];
|
| | | break;
|
| | | }
|
| | | }
|
| | | index = i;
|
| | | break;
|
| | | }
|
| | |
|
| | | if (zhanLingInfo.isActivite > 0 && !isHavePaid)
|
| | | {
|
| | | index = i;
|
| | | break;
|
| | | }
|
| | |
|
| | | if (zhanLingInfo.isActiviteH > 0 && !isHavePaidH)
|
| | | {
|
| | | index = i;
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | | var temp = ILZhanlingConfig.GetTypeToIDDict(zhanLingType).Keys.ToList();
|
| | | int startIndex = temp.IndexOf(maxNeedValue);
|
| | | return Math.Max(0, startIndex);
|
| | |
|
| | | if (allItemsClaimed && zhanLingInfo.isActivite > 0 && zhanLingInfo.isActiviteH > 0)
|
| | | {
|
| | | return infoList.Count - 1;
|
| | | }
|
| | |
|
| | | return Math.Max(0, index - 2);
|
| | | }
|
| | |
|
| | | //一键获取所有可领取的礼品,弹出展示窗口
|
| | |
| | | //获取最小未领取的物品索引
|
| | | public int GetJumpStartIndex(int zhanLingType)
|
| | | {
|
| | | List<int> needValueList = ILZhanlingConfig.GetTypeToIDDict(zhanLingType).Keys.ToList();
|
| | | int maxNeedValue = ILZhanlingConfig.GetTypeToIDDict(zhanLingType).Keys.ToList()[0];
|
| | | for (int i = 0; i < needValueList.Count; i++)
|
| | | var infoDict = ILZhanlingConfig.GetTypeToIDDict(zhanLingType);
|
| | | if (infoDict.IsNullOrEmpty())
|
| | | return 0;
|
| | |
|
| | | List<int> infoList = infoDict.Keys.ToList();
|
| | | if (infoList.IsNullOrEmpty())
|
| | | return 0;
|
| | |
|
| | | if (zhanLingInfoDict.IsNullOrEmpty() || !zhanLingInfoDict.ContainsKey(zhanLingType))
|
| | | return 0;
|
| | |
|
| | | var zhanLingInfo = zhanLingInfoDict[zhanLingType];
|
| | |
|
| | | int index = 0;
|
| | | bool allItemsClaimed = true;
|
| | |
|
| | | for (int i = 0; i < infoList.Count; i++)
|
| | | {
|
| | | if (IsNeedValueOk(needValueList[i]))
|
| | | int needValue = infoList[i];
|
| | | bool isHaveFree = zhanLingInfo.freeZhanHaveDict.GetValueOrDefault(needValue, 0) > 0;
|
| | | bool isHavePaid = zhanLingInfo.paidZhanHaveDict.GetValueOrDefault(needValue, 0) > 0;
|
| | | bool isHavePaidH = zhanLingInfo.paidZhanHaveHDict.GetValueOrDefault(needValue, 0) > 0;
|
| | |
|
| | | if (!isHaveFree || !isHavePaid || !isHavePaidH)
|
| | | {
|
| | | bool isHaveFree = zhanLingInfoDict[zhanLingType].paidZhanHaveDict[needValueList[i]] > 0;
|
| | | bool isHavePaid = zhanLingInfoDict[zhanLingType].paidZhanHaveDict[needValueList[i]] > 0;
|
| | | bool isHavePaidH = zhanLingInfoDict[zhanLingType].paidZhanHaveHDict[needValueList[i]] > 0;
|
| | | if (zhanLingInfoDict[zhanLingType].isActiviteH > 0)
|
| | | allItemsClaimed = false;
|
| | | if (!isHaveFree)
|
| | | {
|
| | | if (!isHaveFree || !isHavePaid || !isHavePaidH)
|
| | | {
|
| | | maxNeedValue = needValueList[i];
|
| | | break;
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | if (zhanLingInfoDict[zhanLingType].isActivite > 0)
|
| | | {
|
| | | if (!isHaveFree || !isHavePaid)
|
| | | {
|
| | | maxNeedValue = needValueList[i];
|
| | | break;
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | if (!isHaveFree)
|
| | | {
|
| | | maxNeedValue = needValueList[i];
|
| | | break;
|
| | | }
|
| | | }
|
| | | index = i;
|
| | | break;
|
| | | }
|
| | |
|
| | | if (zhanLingInfo.isActivite > 0 && !isHavePaid)
|
| | | {
|
| | | index = i;
|
| | | break;
|
| | | }
|
| | |
|
| | | if (zhanLingInfo.isActiviteH > 0 && !isHavePaidH)
|
| | | {
|
| | | index = i;
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | | var temp = ILZhanlingConfig.GetTypeToIDDict(zhanLingType).Keys.ToList();
|
| | | int startIndex = temp.IndexOf(maxNeedValue);
|
| | | return Math.Max(0, startIndex);
|
| | |
|
| | | if (allItemsClaimed && zhanLingInfo.isActivite > 0 && zhanLingInfo.isActiviteH > 0)
|
| | | {
|
| | | return infoList.Count - 1;
|
| | | }
|
| | |
|
| | | return Math.Max(0, index - 2);
|
| | | }
|
| | |
|
| | | //一键获取所有可领取的礼品,弹出展示窗口
|
| | |
| | | //获取最小未领取的物品索引
|
| | | public int GetJumpStartIndex(int zhanLingType)
|
| | | {
|
| | | List<int> needValueList = ILZhanlingConfig.GetTypeToIDDict(zhanLingType).Keys.ToList();
|
| | | int maxNeedValue = ILZhanlingConfig.GetTypeToIDDict(zhanLingType).Keys.ToList()[0];
|
| | | for (int i = 0; i < needValueList.Count; i++)
|
| | | var infoDict = ILZhanlingConfig.GetTypeToIDDict(zhanLingType);
|
| | | if (infoDict.IsNullOrEmpty())
|
| | | return 0;
|
| | |
|
| | | List<int> infoList = infoDict.Keys.ToList();
|
| | | if (infoList.IsNullOrEmpty())
|
| | | return 0;
|
| | |
|
| | | if (zhanLingInfoDict.IsNullOrEmpty() || !zhanLingInfoDict.ContainsKey(zhanLingType))
|
| | | return 0;
|
| | |
|
| | | var zhanLingInfo = zhanLingInfoDict[zhanLingType];
|
| | |
|
| | | int index = 0;
|
| | | bool allItemsClaimed = true;
|
| | |
|
| | | for (int i = 0; i < infoList.Count; i++)
|
| | | {
|
| | | if (IsNeedValueOk(needValueList[i]))
|
| | | int needValue = infoList[i];
|
| | | bool isHaveFree = zhanLingInfo.freeZhanHaveDict.GetValueOrDefault(needValue, 0) > 0;
|
| | | bool isHavePaid = zhanLingInfo.paidZhanHaveDict.GetValueOrDefault(needValue, 0) > 0;
|
| | | bool isHavePaidH = zhanLingInfo.paidZhanHaveHDict.GetValueOrDefault(needValue, 0) > 0;
|
| | |
|
| | | if (!isHaveFree || !isHavePaid || !isHavePaidH)
|
| | | {
|
| | | bool isHaveFree = zhanLingInfoDict[zhanLingType].paidZhanHaveDict[needValueList[i]] > 0;
|
| | | bool isHavePaid = zhanLingInfoDict[zhanLingType].paidZhanHaveDict[needValueList[i]] > 0;
|
| | | bool isHavePaidH = zhanLingInfoDict[zhanLingType].paidZhanHaveHDict[needValueList[i]] > 0;
|
| | | if (zhanLingInfoDict[zhanLingType].isActiviteH > 0)
|
| | | allItemsClaimed = false;
|
| | | if (!isHaveFree)
|
| | | {
|
| | | if (!isHaveFree || !isHavePaid || !isHavePaidH)
|
| | | {
|
| | | maxNeedValue = needValueList[i];
|
| | | break;
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | if (zhanLingInfoDict[zhanLingType].isActivite > 0)
|
| | | {
|
| | | if (!isHaveFree || !isHavePaid)
|
| | | {
|
| | | maxNeedValue = needValueList[i];
|
| | | break;
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | if (!isHaveFree)
|
| | | {
|
| | | maxNeedValue = needValueList[i];
|
| | | break;
|
| | | }
|
| | | }
|
| | | index = i;
|
| | | break;
|
| | | }
|
| | |
|
| | | if (zhanLingInfo.isActivite > 0 && !isHavePaid)
|
| | | {
|
| | | index = i;
|
| | | break;
|
| | | }
|
| | |
|
| | | if (zhanLingInfo.isActiviteH > 0 && !isHavePaidH)
|
| | | {
|
| | | index = i;
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | | var temp = ILZhanlingConfig.GetTypeToIDDict(zhanLingType).Keys.ToList();
|
| | | int startIndex = temp.IndexOf(maxNeedValue);
|
| | | return Math.Max(0, startIndex);
|
| | |
|
| | | if (allItemsClaimed && zhanLingInfo.isActivite > 0 && zhanLingInfo.isActiviteH > 0)
|
| | | {
|
| | | return infoList.Count - 1;
|
| | | }
|
| | |
|
| | | return Math.Max(0, index - 2);
|
| | | }
|
| | |
|
| | | //一键获取所有可领取的礼品,弹出展示窗口
|
| | |
| | | //获取最小未领取的物品索引
|
| | | public int GetJumpStartIndex(int zhanLingType)
|
| | | {
|
| | | List<int> needValueList = ILZhanlingConfig.GetTypeToIDDict(zhanLingType).Keys.ToList();
|
| | | int maxNeedValue = ILZhanlingConfig.GetTypeToIDDict(zhanLingType).Keys.ToList()[0];
|
| | | for (int i = 0; i < needValueList.Count; i++)
|
| | | var infoDict = ILZhanlingConfig.GetTypeToIDDict(zhanLingType);
|
| | | if (infoDict.IsNullOrEmpty())
|
| | | return 0;
|
| | |
|
| | | List<int> infoList = infoDict.Keys.ToList();
|
| | | if (infoList.IsNullOrEmpty())
|
| | | return 0;
|
| | |
|
| | | if (zhanLingInfoDict.IsNullOrEmpty() || !zhanLingInfoDict.ContainsKey(zhanLingType))
|
| | | return 0;
|
| | |
|
| | | var zhanLingInfo = zhanLingInfoDict[zhanLingType];
|
| | |
|
| | | int index = 0;
|
| | | bool allItemsClaimed = true;
|
| | |
|
| | | for (int i = 0; i < infoList.Count; i++)
|
| | | {
|
| | | if (IsNeedValueOk(needValueList[i]))
|
| | | int needValue = infoList[i];
|
| | | bool isHaveFree = zhanLingInfo.freeZhanHaveDict.GetValueOrDefault(needValue, 0) > 0;
|
| | | bool isHavePaid = zhanLingInfo.paidZhanHaveDict.GetValueOrDefault(needValue, 0) > 0;
|
| | | bool isHavePaidH = zhanLingInfo.paidZhanHaveHDict.GetValueOrDefault(needValue, 0) > 0;
|
| | |
|
| | | if (!isHaveFree || !isHavePaid || !isHavePaidH)
|
| | | {
|
| | | bool isHaveFree = zhanLingInfoDict[zhanLingType].paidZhanHaveDict[needValueList[i]] > 0;
|
| | | bool isHavePaid = zhanLingInfoDict[zhanLingType].paidZhanHaveDict[needValueList[i]] > 0;
|
| | | bool isHavePaidH = zhanLingInfoDict[zhanLingType].paidZhanHaveHDict[needValueList[i]] > 0;
|
| | | if (zhanLingInfoDict[zhanLingType].isActiviteH > 0)
|
| | | allItemsClaimed = false;
|
| | | if (!isHaveFree)
|
| | | {
|
| | | if (!isHaveFree || !isHavePaid || !isHavePaidH)
|
| | | {
|
| | | maxNeedValue = needValueList[i];
|
| | | break;
|
| | | }
|
| | | index = i;
|
| | | break;
|
| | | }
|
| | | else
|
| | |
|
| | | if (zhanLingInfo.isActivite > 0 && !isHavePaid)
|
| | | {
|
| | | if (zhanLingInfoDict[zhanLingType].isActivite > 0)
|
| | | {
|
| | | if (!isHaveFree || !isHavePaid)
|
| | | {
|
| | | maxNeedValue = needValueList[i];
|
| | | break;
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | if (!isHaveFree)
|
| | | {
|
| | | maxNeedValue = needValueList[i];
|
| | | break;
|
| | | }
|
| | | }
|
| | | index = i;
|
| | | break;
|
| | | }
|
| | |
|
| | | if (zhanLingInfo.isActiviteH > 0 && !isHavePaidH)
|
| | | {
|
| | | index = i;
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | | var temp = ILZhanlingConfig.GetTypeToIDDict(zhanLingType).Keys.ToList();
|
| | | int startIndex = temp.IndexOf(maxNeedValue);
|
| | | return Math.Max(0, startIndex);
|
| | |
|
| | | if (allItemsClaimed && zhanLingInfo.isActivite > 0 && zhanLingInfo.isActiviteH > 0)
|
| | | {
|
| | | return infoList.Count - 1;
|
| | | }
|
| | |
|
| | | return Math.Max(0, index - 2);
|
| | | }
|
| | |
|
| | | //一键获取所有可领取的礼品,弹出展示窗口
|