53 lines
1.5 KiB
Java
53 lines
1.5 KiB
Java
package config;
|
|
|
|
import manager.STableManager;
|
|
import manager.Table;
|
|
|
|
import java.util.HashMap;
|
|
import java.util.Map;
|
|
|
|
@Table(name ="EquipSuiteConfig")
|
|
public class SEquipSuiteConfig implements BaseConfig {
|
|
|
|
private int id;
|
|
|
|
private int[][] suiteValue;
|
|
|
|
private Map<Integer,Map<Integer,Integer>> suiteMap;
|
|
public static Map<Integer, SEquipSuiteConfig> config;
|
|
|
|
|
|
@Override
|
|
public void init() throws Exception {
|
|
Map<Integer, SEquipSuiteConfig> configTmp = STableManager.getConfig(SEquipSuiteConfig.class);
|
|
configTmp.values().forEach(item->{
|
|
Map<Integer,Map<Integer,Integer>> suiteMapTmp = new HashMap<>();
|
|
int[][] suiteValue = item.getSuiteValue();
|
|
for(int[] suiteItem :suiteValue){
|
|
suiteMapTmp.putIfAbsent(suiteItem[0],suiteMapTmp.getOrDefault(suiteItem[0],new HashMap<>(suiteMapTmp.getOrDefault(suiteItem[0]-1,new HashMap<>()))));
|
|
suiteMapTmp.get(suiteItem[0]).put(suiteItem[1], suiteMapTmp.get(suiteItem[0]).getOrDefault(suiteItem[1],0) + suiteItem[2]);
|
|
}
|
|
item.setSuiteMap(suiteMapTmp);
|
|
});
|
|
config=configTmp;
|
|
}
|
|
|
|
|
|
public Map<Integer, Map<Integer, Integer>> getSuiteMap() {
|
|
return suiteMap;
|
|
}
|
|
|
|
public void setSuiteMap(Map<Integer, Map<Integer, Integer>> suiteMap) {
|
|
this.suiteMap = suiteMap;
|
|
}
|
|
|
|
public int getId() {
|
|
return id;
|
|
}
|
|
|
|
public int[][] getSuiteValue() {
|
|
return suiteValue;
|
|
}
|
|
|
|
|
|
} |