123 lines
2.5 KiB
Java
123 lines
2.5 KiB
Java
|
package config;
|
||
|
|
||
|
import manager.STableManager;
|
||
|
import manager.Table;
|
||
|
|
||
|
import java.util.ArrayList;
|
||
|
import java.util.List;
|
||
|
import java.util.Map;
|
||
|
import java.util.concurrent.ConcurrentHashMap;
|
||
|
|
||
|
@Table(name ="StoreConfig")
|
||
|
public class SStoreConfig implements BaseConfig {
|
||
|
private static Map<Integer, SStoreConfig> sStoreConfigMap;
|
||
|
//key: type 商店类型
|
||
|
private static Map<Integer, List<SStoreConfig>> sStoreConfigMapBuyType;
|
||
|
|
||
|
private int id;
|
||
|
|
||
|
private String goodsName;
|
||
|
|
||
|
private int sort;
|
||
|
|
||
|
private int storeId;
|
||
|
|
||
|
private int[] openLv;
|
||
|
|
||
|
private int[][] goods;
|
||
|
|
||
|
private int weight;
|
||
|
|
||
|
private int[][] cost;
|
||
|
|
||
|
private int limit;
|
||
|
|
||
|
private int isDiscount;
|
||
|
|
||
|
private int discountDegree;
|
||
|
|
||
|
private int premiumType;
|
||
|
|
||
|
private int relatedtoVIP;
|
||
|
|
||
|
private int[][] extraAdd;
|
||
|
|
||
|
|
||
|
@Override
|
||
|
public void init() throws Exception {
|
||
|
sStoreConfigMap = STableManager.getConfig(SStoreConfig.class);
|
||
|
Map<Integer, List<SStoreConfig>> sStoreConfigMapBuyType = new ConcurrentHashMap<>();
|
||
|
for (Map.Entry<Integer, SStoreConfig> entry :sStoreConfigMap.entrySet()){
|
||
|
SStoreConfig data = entry.getValue();
|
||
|
if (!sStoreConfigMapBuyType.containsKey(data.getStoreId())) {
|
||
|
sStoreConfigMapBuyType.put((data.getStoreId()), new ArrayList<SStoreConfig>());
|
||
|
}
|
||
|
sStoreConfigMapBuyType.get(data.getStoreId()).add(data);
|
||
|
}
|
||
|
SStoreConfig.sStoreConfigMapBuyType = sStoreConfigMapBuyType;
|
||
|
}
|
||
|
|
||
|
public static Map<Integer, SStoreConfig> getSstoreConfigMap() {
|
||
|
return sStoreConfigMap;
|
||
|
}
|
||
|
|
||
|
public static Map<Integer, List<SStoreConfig>> getSstoreConfigBuyStore() {
|
||
|
return sStoreConfigMapBuyType;
|
||
|
}
|
||
|
|
||
|
public int getId() {
|
||
|
return id;
|
||
|
}
|
||
|
|
||
|
public String getGoodsName() {
|
||
|
return goodsName;
|
||
|
}
|
||
|
|
||
|
public int getSort() {
|
||
|
return sort;
|
||
|
}
|
||
|
|
||
|
public int getStoreId() {
|
||
|
return storeId;
|
||
|
}
|
||
|
|
||
|
public int[] getOpenLv() {
|
||
|
return openLv;
|
||
|
}
|
||
|
|
||
|
public int[][] getGoods() {
|
||
|
return goods;
|
||
|
}
|
||
|
|
||
|
public int getWeight() {
|
||
|
return weight;
|
||
|
}
|
||
|
|
||
|
public int[][] getCost() {
|
||
|
return cost;
|
||
|
}
|
||
|
|
||
|
public int getLimit() {
|
||
|
return limit;
|
||
|
}
|
||
|
|
||
|
public int getIsDiscount() {
|
||
|
return isDiscount;
|
||
|
}
|
||
|
|
||
|
public int getDiscountDegree() {
|
||
|
return discountDegree;
|
||
|
}
|
||
|
|
||
|
public int getPremiumType() {
|
||
|
return premiumType;
|
||
|
}
|
||
|
|
||
|
public int getRelatedtoVIP() {
|
||
|
return relatedtoVIP;
|
||
|
}
|
||
|
|
||
|
public int[][] getExtraAdd() {
|
||
|
return extraAdd;
|
||
|
}
|
||
|
}
|