| | |
| | | } |
| | | |
| | | private List<HollowGlassQueueInfo> computeOutHollowQueue(List<HollowGlassQueueInfo> queueInfoList, HollowGlassOutRelationInfo hollowGlassOutRelationInfo) { |
| | | if (CollectionUtil.isNotEmpty(queueInfoList)) { |
| | | if (CollectionUtil.isEmpty(queueInfoList)) { |
| | | return new ArrayList<>(); |
| | | } |
| | | //任务为强制,只直接返回原有的队列 |
| | |
| | | List<HollowGlassQueueInfo> resultQueue = new ArrayList<>(); |
| | | |
| | | for (List<HollowGlassQueueInfo> items : gridGroups.values()) { |
| | | // 情况1:格子内只有一个数据且未配对 - 过滤掉 |
| | | if (items.size() == 1 && 0 == items.get(0).getSlot()) { |
| | | continue; |
| | | } |
| | | |
| | | // 情况2:格子内全部为未配对的数据 - 过滤掉 |
| | | boolean allUnpaired = items.stream().noneMatch(e -> e.getIsPair() == 1); |
| | | if (allUnpaired) { |
| | |
| | | // 否则保留这个格子内的所有数据 |
| | | resultQueue.addAll(items); |
| | | } |
| | | Collections.sort(resultQueue, Comparator.comparing(HollowGlassQueueInfo::getId)); |
| | | return resultQueue; |
| | | } |
| | | |