public void Copy(CMD_ChipSortModal.Data data) { this.isOrderByAsc = data.isOrderByAsc; this.sortType = data.sortType; this.refineTypeList = data.refineTypeList; this.isAllRank = data.isAllRank; this.isAllTribe = data.isAllTribe; }
private static GameWebAPI.RespDataCS_ChipListLogic.UserChipList[] GetRefineSortList(GameWebAPI.RespDataCS_ChipListLogic.UserChipList[] userChipList, CMD_ChipSortModal.Data sortData) { List <GameWebAPI.RespDataCS_ChipListLogic.UserChipList> list = new List <GameWebAPI.RespDataCS_ChipListLogic.UserChipList>(); if (userChipList == null) { return(list.ToArray()); } int num = 0; foreach (CMD_ChipSortModal.RefineType refineType in CMD_ChipSortModal.tribeRefineTypes) { if ((sortData.refineTypeList & (int)refineType) > 0) { num++; } } bool flag = CMD_ChipSortModal.tribeRefineTypes.Length == num || num == 0; int refineTypeList = sortData.refineTypeList; foreach (GameWebAPI.RespDataCS_ChipListLogic.UserChipList userChipList2 in userChipList) { GameWebAPI.RespDataMA_ChipM.Chip chipMainData = ChipDataMng.GetChipMainData(userChipList2); GameWebAPI.RespDataMA_ChipEffectM.ChipEffect[] chipEffectData = ChipDataMng.GetChipEffectData(userChipList2); int num2 = 0; string rank = chipMainData.rank; switch (rank) { case "1": num2 |= 1; break; case "2": num2 |= 2; break; case "3": num2 |= 4; break; case "4": num2 |= 8; break; case "5": num2 |= 16; break; case "6": num2 |= 32; break; case "7": num2 |= 64; break; case "8": num2 |= 128; break; case "9": num2 |= 256; break; case "10": num2 |= 512; break; } bool flag2 = (refineTypeList & num2) > 0; int num4 = 0; foreach (GameWebAPI.RespDataMA_ChipEffectM.ChipEffect chipEffect in chipEffectData) { if (chipEffect.targetSubType == "2") { string targetValue = chipEffect.targetValue; switch (targetValue) { case "1": num4 |= 65536; break; case "2": num4 |= 1024; break; case "3": num4 |= 32768; break; case "4": num4 |= 16384; break; case "5": num4 |= 2048; break; case "6": num4 |= 4096; break; case "7": num4 |= 8192; break; } } } bool flag3 = (refineTypeList & num4) > 0; if (num4 == 0 && flag) { flag3 = true; } if (flag2 && flag3) { list.Add(userChipList2); } } if (sortData.sortType == CMD_ChipSortModal.SortType.Time) { if (sortData.isOrderByAsc) { List <GameWebAPI.RespDataCS_ChipListLogic.UserChipList> list2 = list; if (CMD_ChipSortModal.< > f__mg$cache0 == null) { CMD_ChipSortModal.< > f__mg$cache0 = new Comparison <GameWebAPI.RespDataCS_ChipListLogic.UserChipList>(CMD_ChipSortModal.ComparerTimeOrderByAsc); } list2.Sort(CMD_ChipSortModal.< > f__mg$cache0); } else { List <GameWebAPI.RespDataCS_ChipListLogic.UserChipList> list3 = list; if (CMD_ChipSortModal.< > f__mg$cache1 == null) { CMD_ChipSortModal.< > f__mg$cache1 = new Comparison <GameWebAPI.RespDataCS_ChipListLogic.UserChipList>(CMD_ChipSortModal.ComparerTimeOrderByDesc); } list3.Sort(CMD_ChipSortModal.< > f__mg$cache1); } } else if (sortData.sortType == CMD_ChipSortModal.SortType.Rarity) { if (sortData.isOrderByAsc) { List <GameWebAPI.RespDataCS_ChipListLogic.UserChipList> list4 = list; if (CMD_ChipSortModal.< > f__mg$cache2 == null) { CMD_ChipSortModal.< > f__mg$cache2 = new Comparison <GameWebAPI.RespDataCS_ChipListLogic.UserChipList>(CMD_ChipSortModal.ComparerRarityOrderByAsc); } list4.Sort(CMD_ChipSortModal.< > f__mg$cache2); } else { List <GameWebAPI.RespDataCS_ChipListLogic.UserChipList> list5 = list; if (CMD_ChipSortModal.< > f__mg$cache3 == null) { CMD_ChipSortModal.< > f__mg$cache3 = new Comparison <GameWebAPI.RespDataCS_ChipListLogic.UserChipList>(CMD_ChipSortModal.ComparerRarityOrderByDesc); } list5.Sort(CMD_ChipSortModal.< > f__mg$cache3); } } return(list.ToArray()); }