miduo_server/tablemanager/src/main/java/config/SLotterySetting.java

125 lines
2.7 KiB
Java
Raw Normal View History

package config;
2020-08-10 15:26:19 +08:00
import manager.STableManager;
import manager.Table;
2020-08-10 15:26:19 +08:00
import java.util.HashMap;
import java.util.Map;
@Table(name ="LotterySetting")
public class SLotterySetting implements BaseConfig {
private int id;
2020-08-10 15:26:19 +08:00
private int lotteryType;
private int propertyType;
private int diamondBoxInterval;
2020-08-10 15:26:19 +08:00
private int[][] costItem;
private int freeTimes;
2020-08-10 15:26:19 +08:00
private int maxTimes;
2020-10-24 15:52:25 +08:00
private int moneyTimes;
private int discountTimes;
private int[][] diamondBoxContain;
private int[][] tenTimesMustGetItem;
private int perCount;
private int mergePool;
2019-11-26 17:41:38 +08:00
private int activityId;
2020-08-10 15:26:19 +08:00
public static Map<Integer,Map<Integer,Integer>> changeIds = new HashMap<>();
2020-05-16 16:56:15 +08:00
2020-08-10 15:26:19 +08:00
@Override
public void init() throws Exception {
2020-08-10 15:26:19 +08:00
Map<Integer, Map<Integer, Integer>> integerMapMap = new HashMap<>();
Map<Integer, SLotterySetting> config = STableManager.getConfig(SLotterySetting.class);
for (Map.Entry<Integer,SLotterySetting> entry:config.entrySet()) {
if(entry.getValue().getLotteryType()==7){
Map<Integer, Integer> orDefault = integerMapMap.getOrDefault(4, new HashMap<>());
orDefault.put(entry.getValue().getPropertyType(),entry.getKey());
integerMapMap.put(4,orDefault);
}else if (entry.getValue().getLotteryType()==8){
Map<Integer, Integer> orDefault = integerMapMap.getOrDefault(5, new HashMap<>());
orDefault.put(entry.getValue().getPropertyType(),entry.getKey());
2020-08-12 14:16:08 +08:00
integerMapMap.put(5,orDefault);
2020-08-10 15:26:19 +08:00
}
}
changeIds = integerMapMap;
}
public int getId() {
return id;
}
2020-08-10 15:26:19 +08:00
public int getLotteryType() {
return lotteryType;
}
public int getPropertyType() {
return propertyType;
}
public int getDiamondBoxInterval() {
return diamondBoxInterval;
}
2020-08-10 15:26:19 +08:00
public int[][] getCostItem() {
return costItem;
}
2020-08-10 15:26:19 +08:00
public int getFreeTimes() {
return freeTimes;
}
public int getMaxTimes() {
return maxTimes;
}
public int[][] getDiamondBoxContain() {
return diamondBoxContain;
}
2020-08-10 15:26:19 +08:00
public int[][] getTenTimesMustGetItem() {
return tenTimesMustGetItem;
}
2020-08-10 15:26:19 +08:00
public int getPerCount() {
return perCount;
}
2020-08-10 15:26:19 +08:00
public int getMergePool() {
return mergePool;
}
2019-11-25 11:42:07 +08:00
2020-08-10 15:26:19 +08:00
public int getActivityId() {
2019-11-27 15:43:24 +08:00
return activityId;
}
2020-05-16 16:56:15 +08:00
2020-10-24 15:52:25 +08:00
public int getMoneyTimes() {
return moneyTimes;
}
public int getDiscountTimes() {
return discountTimes;
}
2020-08-10 15:26:19 +08:00
public static Map<Integer, Map<Integer, Integer>> getChangeIds() {
return changeIds;
2020-05-16 16:56:15 +08:00
}
2020-08-10 15:26:19 +08:00
public static void setChangeIds(Map<Integer, Map<Integer, Integer>> changeIds) {
SLotterySetting.changeIds = changeIds;
2020-05-16 16:56:15 +08:00
}
}