125 lines
2.7 KiB
Java
125 lines
2.7 KiB
Java
package config;
|
|
|
|
import manager.STableManager;
|
|
import manager.Table;
|
|
|
|
import java.util.HashMap;
|
|
import java.util.Map;
|
|
|
|
@Table(name ="LotterySetting")
|
|
public class SLotterySetting implements BaseConfig {
|
|
|
|
private int id;
|
|
|
|
private int lotteryType;
|
|
|
|
private int propertyType;
|
|
|
|
private int diamondBoxInterval;
|
|
|
|
private int[][] costItem;
|
|
|
|
private int freeTimes;
|
|
|
|
private int maxTimes;
|
|
|
|
private int moneyTimes;
|
|
|
|
private int discountTimes;
|
|
|
|
private int[][] diamondBoxContain;
|
|
|
|
private int[][] tenTimesMustGetItem;
|
|
|
|
private int perCount;
|
|
|
|
private int mergePool;
|
|
|
|
private int activityId;
|
|
|
|
public static Map<Integer,Map<Integer,Integer>> changeIds = new HashMap<>();
|
|
|
|
@Override
|
|
public void init() throws Exception {
|
|
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());
|
|
integerMapMap.put(5,orDefault);
|
|
}
|
|
}
|
|
changeIds = integerMapMap;
|
|
|
|
}
|
|
|
|
|
|
public int getId() {
|
|
return id;
|
|
}
|
|
|
|
public int getLotteryType() {
|
|
return lotteryType;
|
|
}
|
|
|
|
public int getPropertyType() {
|
|
return propertyType;
|
|
}
|
|
|
|
public int getDiamondBoxInterval() {
|
|
return diamondBoxInterval;
|
|
}
|
|
|
|
public int[][] getCostItem() {
|
|
return costItem;
|
|
}
|
|
|
|
public int getFreeTimes() {
|
|
return freeTimes;
|
|
}
|
|
|
|
public int getMaxTimes() {
|
|
return maxTimes;
|
|
}
|
|
|
|
public int[][] getDiamondBoxContain() {
|
|
return diamondBoxContain;
|
|
}
|
|
|
|
public int[][] getTenTimesMustGetItem() {
|
|
return tenTimesMustGetItem;
|
|
}
|
|
|
|
public int getPerCount() {
|
|
return perCount;
|
|
}
|
|
|
|
public int getMergePool() {
|
|
return mergePool;
|
|
}
|
|
|
|
public int getActivityId() {
|
|
return activityId;
|
|
}
|
|
|
|
public int getMoneyTimes() {
|
|
return moneyTimes;
|
|
}
|
|
|
|
public int getDiscountTimes() {
|
|
return discountTimes;
|
|
}
|
|
|
|
public static Map<Integer, Map<Integer, Integer>> getChangeIds() {
|
|
return changeIds;
|
|
}
|
|
|
|
public static void setChangeIds(Map<Integer, Map<Integer, Integer>> changeIds) {
|
|
SLotterySetting.changeIds = changeIds;
|
|
}
|
|
} |