package config; import manager.STableManager; import manager.Table; import util.MathUtils; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; @Table(name ="FreeTravelStore") public class SFreeTravelStore implements BaseConfig { private int id; private int mapID; private int weight; private int[] goods; private int[] cost; public static Map> storeMapByMapId = new HashMap<>(); @Override public void init() throws Exception { Map configMap = STableManager.getConfig(SFreeTravelStore.class); Map> storeMapByMapIdTemp = new HashMap<>(); for(Map.Entry entry:configMap.entrySet()){ storeMapByMapIdTemp.putIfAbsent(entry.getValue().getMapID(),new ArrayList<>()); storeMapByMapIdTemp.get(entry.getValue().getMapID()).add(entry.getValue()); } storeMapByMapId = storeMapByMapIdTemp; } public int getID() { return id; } public int getMapID() { return mapID; } public int getWeight() { return weight; } public int[] getGoods() { return goods; } public int[] getCost() { return cost; } }