Merge branch 'master_prb_gn' into master_test_gn

jiahuiwen 2021-11-17 13:24:03 +08:00
commit 8a5712fdb2
1 changed files with 18 additions and 9 deletions

View File

@ -781,18 +781,27 @@ public class ItemLogic {
}
public static TreeSet<String> getJewelEquipWithLeve(User user, int type, int rance, int leve) {
return user.getEquipManager().getEquipMap().entrySet().stream().filter(stringEquipEntry ->
StringUtil.isEmpty(stringEquipEntry.getValue().getHeroId())
).filter(stringPropertyItemEntry -> stringPropertyItemEntry.getValue() instanceof Jewel).filter(stringPropertyItemEntry -> {
if (((Jewel) stringPropertyItemEntry.getValue()).getBuildLevel() != 0 || stringPropertyItemEntry.getValue().getLevel() != 0) {
return false;
}
TreeSet<String> strings = new TreeSet<>();
for (Map.Entry<String, PropertyItem> stringPropertyItemEntry : user.getEquipManager().getEquipMap().entrySet()) {
SJewelConfig config = STableManager.getConfig(SJewelConfig.class).get(stringPropertyItemEntry.getValue().getEquipId());
if (config == null) {
return false;
continue;
}
return config.getLocation() == type && config.getRace() == rance && config.getLevel() == leve;
}).map(Map.Entry::getKey).collect(Collectors.toCollection(TreeSet::new));
if (config.getLocation() != type || config.getRace() != rance || config.getLevel() != leve) {
continue;
}
if (!StringUtil.isEmpty(stringPropertyItemEntry.getValue().getHeroId())) {
Hero hero = user.getHeroManager().getHero(stringPropertyItemEntry.getValue().getHeroId());
if (hero != null && hero.getJewelInfo().contains(stringPropertyItemEntry.getKey())) {
continue;
}
}
if (((Jewel) stringPropertyItemEntry.getValue()).getBuildLevel() != 0 || stringPropertyItemEntry.getValue().getLevel() != 0) {
continue;
}
strings.add(stringPropertyItemEntry.getValue().getId());
}
return strings;
}
/**