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; private int gainType; public static Map> changeIds = new HashMap<>(); @Override public void init() throws Exception { Map> integerMapMap = new HashMap<>(); Map config = STableManager.getConfig(SLotterySetting.class); for (Map.Entry entry:config.entrySet()) { if(entry.getValue().getLotteryType()==7){ Map orDefault = integerMapMap.getOrDefault(4, new HashMap<>()); orDefault.put(entry.getValue().getPropertyType(),entry.getKey()); integerMapMap.put(4,orDefault); }else if (entry.getValue().getLotteryType()==8){ Map 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> getChangeIds() { return changeIds; } public static void setChangeIds(Map> changeIds) { SLotterySetting.changeIds = changeIds; } public int getGainType() { return gainType; } }