componts add

back_recharge
wangyuan 2019-10-29 14:56:37 +08:00
parent fab234e810
commit b564b7ae7d
1 changed files with 11 additions and 3 deletions

View File

@ -34,14 +34,14 @@ public class SDifferDemonsComonpentsConfig implements BaseConfig {
for(SDifferDemonsComonpentsConfig sDifferDemonsComonpentsConfig : config.values()){
int comonpentsId = sDifferDemonsComonpentsConfig.getComonpentsId();
int stage = sDifferDemonsComonpentsConfig.getStage();
if(!sDifferDemonsComonpentsConfigTmp.containsKey(comonpentsId)){
sDifferDemonsComonpentsConfigTmp.put(comonpentsId,new HashMap<>());
extraAddMapTmp.put(comonpentsId,new HashMap<>());
}
int[][] extraAdd = sDifferDemonsComonpentsConfig.getExtraAdd();
Map<Integer, Map<Integer, Integer>> extraMapTmpInfo = extraAddMapTmp.get(comonpentsId);
HashMap<Integer, Map<Integer, Integer>> extraCopyMapHashMap = new HashMap<>(extraMapTmpInfo);
if(extraAdd!=null&&extraAdd.length>0){
Map<Integer, Map<Integer, Integer>> extraMapTmpInfo = extraAddMapTmp.get(comonpentsId);
for(int [] extraItem : extraAdd){
int profession = extraItem[0];
int propertyId = extraItem[1];
@ -49,10 +49,18 @@ public class SDifferDemonsComonpentsConfig implements BaseConfig {
if(!extraMapTmpInfo.containsKey(profession)){
extraMapTmpInfo.put(profession,new HashMap<>());
}
if(extraMapTmpInfo.get(profession).containsKey(propertyId)){
propertyValue+=extraMapTmpInfo.get(profession).get(propertyId);
}
extraCopyMapHashMap.put(profession,new HashMap<>());
extraMapTmpInfo.put(profession,new HashMap<>());
extraCopyMapHashMap.get(profession).put(propertyId,propertyValue);
extraMapTmpInfo.get(profession).put(propertyId,propertyValue);
}
sDifferDemonsComonpentsConfig.setExtraAddMap(new HashMap<>(extraMapTmpInfo));
}
sDifferDemonsComonpentsConfig.setExtraAddMap(extraCopyMapHashMap);
sDifferDemonsComonpentsConfigTmp.get(comonpentsId).put(stage,sDifferDemonsComonpentsConfig);
}