72 lines
1.6 KiB
Java
72 lines
1.6 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 type;
|
||
|
|
||
|
private int count;
|
||
|
|
||
|
private int min_num;
|
||
|
|
||
|
private int max_num;
|
||
|
|
||
|
private int pool_id;
|
||
|
|
||
|
private static Map<Integer, List<SLotterySpecialConfig>> lotterySpecialConfigMap;
|
||
|
|
||
|
|
||
|
@Override
|
||
|
public void init() throws Exception {
|
||
|
Map<Integer, SLotterySpecialConfig> config = STableManager.getConfig(SLotterySpecialConfig.class);
|
||
|
Map<Integer, List<SLotterySpecialConfig>> lotterySpecialConfigMapTmp = new HashMap<>();
|
||
|
for(SLotterySpecialConfig sLotterySpecialConfig : config.values()){
|
||
|
int type = sLotterySpecialConfig.getType();
|
||
|
if(!lotterySpecialConfigMapTmp.containsKey(type)){
|
||
|
lotterySpecialConfigMapTmp.put(type,new ArrayList<>());
|
||
|
}
|
||
|
lotterySpecialConfigMapTmp.get(type).add(sLotterySpecialConfig);
|
||
|
}
|
||
|
lotterySpecialConfigMap = lotterySpecialConfigMapTmp;
|
||
|
}
|
||
|
|
||
|
public static List<SLotterySpecialConfig> getLotterySpecialConfigListByType(int type) {
|
||
|
return lotterySpecialConfigMap.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;
|
||
|
}
|
||
|
|
||
|
|
||
|
}
|