2019-09-06 11:04:28 +08:00
|
|
|
package config;
|
|
|
|
|
2020-08-10 15:26:19 +08:00
|
|
|
import manager.STableManager;
|
2019-09-06 11:04:28 +08:00
|
|
|
import manager.Table;
|
|
|
|
|
2020-08-10 15:26:19 +08:00
|
|
|
import java.util.HashMap;
|
|
|
|
import java.util.Map;
|
|
|
|
|
2019-09-06 11:04:28 +08:00
|
|
|
@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;
|
|
|
|
|
2019-09-06 11:04:28 +08:00
|
|
|
private int diamondBoxInterval;
|
|
|
|
|
2020-08-10 15:26:19 +08:00
|
|
|
private int[][] costItem;
|
|
|
|
|
|
|
|
private int freeTimes;
|
2019-09-06 11:04:28 +08:00
|
|
|
|
2020-08-10 15:26:19 +08:00
|
|
|
private int maxTimes;
|
2019-09-06 11:04:28 +08:00
|
|
|
|
2020-10-24 15:52:25 +08:00
|
|
|
private int moneyTimes;
|
|
|
|
|
|
|
|
private int discountTimes;
|
|
|
|
|
|
|
|
private int[][] diamondBoxContain;
|
2019-09-06 11:04:28 +08:00
|
|
|
|
|
|
|
private int[][] tenTimesMustGetItem;
|
|
|
|
|
|
|
|
private int perCount;
|
|
|
|
|
2019-11-22 16:39:54 +08:00
|
|
|
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
|
2019-09-06 11:04:28 +08:00
|
|
|
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;
|
2019-10-11 16:32:20 +08:00
|
|
|
|
2019-09-06 11:04:28 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int getId() {
|
|
|
|
return id;
|
|
|
|
}
|
|
|
|
|
2020-08-10 15:26:19 +08:00
|
|
|
public int getLotteryType() {
|
|
|
|
return lotteryType;
|
|
|
|
}
|
|
|
|
|
|
|
|
public int getPropertyType() {
|
|
|
|
return propertyType;
|
|
|
|
}
|
|
|
|
|
2019-09-06 11:04:28 +08:00
|
|
|
public int getDiamondBoxInterval() {
|
|
|
|
return diamondBoxInterval;
|
|
|
|
}
|
|
|
|
|
2020-08-10 15:26:19 +08:00
|
|
|
public int[][] getCostItem() {
|
|
|
|
return costItem;
|
2019-09-06 11:04:28 +08:00
|
|
|
}
|
|
|
|
|
2020-08-10 15:26:19 +08:00
|
|
|
public int getFreeTimes() {
|
|
|
|
return freeTimes;
|
|
|
|
}
|
|
|
|
|
|
|
|
public int getMaxTimes() {
|
|
|
|
return maxTimes;
|
|
|
|
}
|
2019-09-06 11:04:28 +08:00
|
|
|
|
|
|
|
public int[][] getDiamondBoxContain() {
|
|
|
|
return diamondBoxContain;
|
|
|
|
}
|
|
|
|
|
2020-08-10 15:26:19 +08:00
|
|
|
public int[][] getTenTimesMustGetItem() {
|
2019-09-06 11:04:28 +08:00
|
|
|
return tenTimesMustGetItem;
|
|
|
|
}
|
|
|
|
|
2020-08-10 15:26:19 +08:00
|
|
|
public int getPerCount() {
|
2019-09-06 11:04:28 +08:00
|
|
|
return perCount;
|
|
|
|
}
|
|
|
|
|
2020-08-10 15:26:19 +08:00
|
|
|
public int getMergePool() {
|
2019-11-22 16:39:54 +08:00
|
|
|
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
|
|
|
}
|
2019-09-06 11:04:28 +08:00
|
|
|
}
|