84 lines
2.2 KiB
Java
84 lines
2.2 KiB
Java
package config;
|
|
|
|
import manager.STableManager;
|
|
import manager.Table;
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.HashMap;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
|
|
@Table(name ="LotterySpecialConfig")
|
|
public class SLotterySpecialConfig implements BaseConfig {
|
|
|
|
private int id;
|
|
|
|
private int differentType;
|
|
|
|
private int type;
|
|
|
|
private int count;
|
|
|
|
private int min_num;
|
|
|
|
private int max_num;
|
|
|
|
private int pool_id;
|
|
|
|
|
|
private static Map<Integer, Map<Integer,List<SLotterySpecialConfig>>> lotterySpecialConfigMap;
|
|
|
|
|
|
@Override
|
|
public void init() throws Exception {
|
|
Map<Integer, SLotterySpecialConfig> config = STableManager.getConfig(SLotterySpecialConfig.class);
|
|
Map<Integer, Map<Integer,List<SLotterySpecialConfig>>> lotterySpecialConfigMapTmp = new HashMap<>();
|
|
for(SLotterySpecialConfig sLotterySpecialConfig : config.values()){
|
|
int differentType = sLotterySpecialConfig.getDifferentType();
|
|
if(!lotterySpecialConfigMapTmp.containsKey(differentType)){
|
|
lotterySpecialConfigMapTmp.put(differentType,new HashMap<>());
|
|
}
|
|
int type = sLotterySpecialConfig.getType();
|
|
if(!lotterySpecialConfigMapTmp.get(differentType).containsKey(type)){
|
|
lotterySpecialConfigMapTmp.get(differentType).put(type,new ArrayList<>());
|
|
}
|
|
lotterySpecialConfigMapTmp.get(differentType).get(type).add(sLotterySpecialConfig);
|
|
}
|
|
lotterySpecialConfigMap = lotterySpecialConfigMapTmp;
|
|
}
|
|
|
|
public static List<SLotterySpecialConfig> getLotterySpecialConfigListByType(int differentType,int type) {
|
|
if(!lotterySpecialConfigMap.containsKey(differentType)){
|
|
return null;
|
|
}
|
|
return lotterySpecialConfigMap.get(differentType).get(type);
|
|
}
|
|
|
|
public int getId() {
|
|
return id;
|
|
}
|
|
|
|
public int getType() {
|
|
return type;
|
|
}
|
|
|
|
public int getCount() {
|
|
return count;
|
|
}
|
|
|
|
public int getMin_num() {
|
|
return min_num;
|
|
}
|
|
|
|
public int getMax_num() {
|
|
return max_num;
|
|
}
|
|
|
|
public int getpool_id() {
|
|
return pool_id;
|
|
}
|
|
|
|
public int getDifferentType() {
|
|
return differentType;
|
|
}
|
|
} |