package config; import manager.STableManager; import manager.Table; import java.util.HashMap; import java.util.Map; @Table(name ="PropertyConfig") public class SPropertyConfig implements BaseConfig { private int id; private int propertyId; private int style; private float score; private int targetPropertyId; private int ifFormula; private static Map sPropertyConfigByPIDMap; @Override public void init() throws Exception { Map sPropertyConfigByPIDMapTmp = new HashMap<>(); Map config = STableManager.getConfig(SPropertyConfig.class); for(SPropertyConfig sPropertyConfig : config.values()){ int propertyId = sPropertyConfig.getPropertyId(); sPropertyConfigByPIDMapTmp.put(propertyId,sPropertyConfig); } sPropertyConfigByPIDMap = sPropertyConfigByPIDMapTmp; } public static SPropertyConfig getsPropertyConfigByPID(int propertyId) { return sPropertyConfigByPIDMap.get(propertyId); } public int getId() { return id; } public int getPropertyId() { return propertyId; } public int getStyle() { return style; } public float getScore() { return score; } public int getTargetPropertyId() { return targetPropertyId; } public int getIfFormula() { return ifFormula; } }