private List<GoodsDerivativeAttriItem> getRecatingAttriList(RoleGoods roleGoods) { if (Util.isEmpty(roleGoods.getAttrVarList())) { return null; } int quality = this.getQualityType(); int star = this.star; if (null != roleGoods) { quality = roleGoods.getQuality(); star = roleGoods.getStar(); } List<GoodsDerivativeAttriItem> derivativeItems = new ArrayList<GoodsDerivativeAttriItem>(); for (AttriItem ai : roleGoods.getAttrVarList()) { if (null == ai) { continue; } byte attriType = ai.getAttriTypeValue(); EquipRecatingAttrWeightConfig awc = GameContext.getGoodsApp().getEquipRecatingAttrWeightConfig(attriType, quality, star); if (null == awc) { continue; } int value = (int) ai.getValue(); RecatingBoundBean bean = awc.getRecatingBoundBean(value); if (null == bean) { continue; } GoodsDerivativeAttriItem rii = new GoodsDerivativeAttriItem(); rii.setType(attriType); rii.setValue(value); rii.setQuality((byte) bean.getQualityType()); derivativeItems.add(rii); } return derivativeItems; }
/** * 统计洗练属性品质>=quality的个数 * * @param roleGoods * @param quality * @return */ public static int countRecastingAttribute(RoleGoods roleGoods, int quality) { int total = 0; for (AttriItem ai : roleGoods.getAttrVarList()) { if (null == ai) { continue; } byte attriType = ai.getAttriTypeValue(); EquipRecatingAttrWeightConfig awc = GameContext.getGoodsApp() .getEquipRecatingAttrWeightConfig( attriType, roleGoods.getQuality(), roleGoods.getStar()); if (null == awc) { continue; } int value = (int) ai.getValue(); RecatingBoundBean bean = awc.getRecatingBoundBean(value); if (null == bean) { continue; } if (bean.getQualityType() < quality) { continue; } total++; } return total; }