65 lines
1.6 KiB
Java
65 lines
1.6 KiB
Java
package config;
|
|
|
|
import manager.STableManager;
|
|
import manager.Table;
|
|
|
|
import java.util.HashMap;
|
|
import java.util.Map;
|
|
|
|
@Table(name ="DifferDemonsConfig")
|
|
public class SDifferDemonsConfig implements BaseConfig {
|
|
|
|
private int id;
|
|
|
|
private int[][] openRules;
|
|
|
|
private int[] comonpentList;
|
|
|
|
private String name;
|
|
|
|
private int quality;
|
|
|
|
public static Map<Integer,SDifferDemonsConfig> sDifferDemonsConfigMap;
|
|
|
|
public static Map<Integer,SDifferDemonsConfig> sDifferDemonsConfigMapByComId;
|
|
|
|
|
|
@Override
|
|
public void init() throws Exception {
|
|
Map<Integer, SDifferDemonsConfig> config = STableManager.getConfig(SDifferDemonsConfig.class);
|
|
Map<Integer,SDifferDemonsConfig> sDifferDemonsConfigMapByComIdTmp = new HashMap<>();
|
|
for(SDifferDemonsConfig sDifferDemonsConfig : config.values()){
|
|
int[] comonpentList = sDifferDemonsConfig.getComonpentList();
|
|
for(int comId : comonpentList){
|
|
sDifferDemonsConfigMapByComIdTmp.put(comId,sDifferDemonsConfig);
|
|
}
|
|
}
|
|
sDifferDemonsConfigMap = config;
|
|
sDifferDemonsConfigMapByComId = sDifferDemonsConfigMapByComIdTmp;
|
|
|
|
}
|
|
|
|
public static SDifferDemonsConfig getsDifferDemonsConfigByPokenID(int pokenmonId) {
|
|
return sDifferDemonsConfigMap.get(pokenmonId);
|
|
}
|
|
|
|
public int getId() {
|
|
return id;
|
|
}
|
|
|
|
public int[][] getOpenRules() {
|
|
return openRules;
|
|
}
|
|
|
|
public int[] getComonpentList() {
|
|
return comonpentList;
|
|
}
|
|
|
|
public String getName() {
|
|
return name;
|
|
}
|
|
|
|
public int getQuality() {
|
|
return quality;
|
|
}
|
|
} |