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 ="LotteryRewardConfig") public class SLotteryRewardConfig implements BaseConfig { private int id; private int[] reward; private String itemName; private int pool; private int weight; private int[] openRules; private int star; // 所有卡池 private static Map> sLotteryRewardConfigsByPoolId; public static List getSLotteryRewardConfigListByPoolId(int poolId) { return sLotteryRewardConfigsByPoolId.get(poolId); } @Override public void init() throws Exception { Map config = STableManager.getConfig(SLotteryRewardConfig.class); Map> sLotteryRewardConfigsByPoolIdTmp = new HashMap<>(); for(SLotteryRewardConfig sLotteryRewardConfig : config.values()){ int pool = sLotteryRewardConfig.getPool(); if(!sLotteryRewardConfigsByPoolIdTmp.containsKey(pool)){ sLotteryRewardConfigsByPoolIdTmp.put(pool,new ArrayList<>()); } sLotteryRewardConfigsByPoolIdTmp.get(pool).add(sLotteryRewardConfig); } sLotteryRewardConfigsByPoolId = sLotteryRewardConfigsByPoolIdTmp; } public int getId() { return id; } public int[] getReward() { return reward; } public String getItemName() { return itemName; } public int getPool() { return pool; } public int getWeight() { return weight; } public int[] getOpenRules() { return openRules; } public int getStar() { return star; } }