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 ="EquipPropertyPool") public class SEquipPropertyPool implements BaseConfig { private static Map> SEquipPropertyPoolByIdMap; private int id; private int propertyId; private int min; private int max; private int poolNum; private int weight; @Override public void init() throws Exception { Map> sEquipPropertyPoolByIdMapTmp = new HashMap<>(); Map config = STableManager.getConfig(SEquipPropertyPool.class); for(SEquipPropertyPool sEquipPropertyPool : config.values()){ int poolNum = sEquipPropertyPool.getPoolNum(); int weight = sEquipPropertyPool.getWeight(); if(weight==0){ continue; } if(!sEquipPropertyPoolByIdMapTmp.containsKey(poolNum)){ sEquipPropertyPoolByIdMapTmp.put(poolNum,new ArrayList<>()); } sEquipPropertyPoolByIdMapTmp.get(poolNum).add(sEquipPropertyPool); } SEquipPropertyPoolByIdMap = sEquipPropertyPoolByIdMapTmp; } public static List getSEquipPropertyPool(int poolId) { return SEquipPropertyPoolByIdMap.get(poolId); } public int getId() { return id; } public int getPropertyId() { return propertyId; } public int getMin() { return min; } public int getMax() { return max; } public int getPoolNum() { return poolNum; } public int getWeight() { return weight; } }