61 lines
1.3 KiB
Java
61 lines
1.3 KiB
Java
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<Integer, List<SFreeTravelStore>> storeMapByMapId = new HashMap<>();
|
|
|
|
|
|
@Override
|
|
public void init() throws Exception {
|
|
Map<Integer, SFreeTravelStore> configMap = STableManager.getConfig(SFreeTravelStore.class);
|
|
Map<Integer, List<SFreeTravelStore>> storeMapByMapIdTemp = new HashMap<>();
|
|
for(Map.Entry<Integer, SFreeTravelStore> 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;
|
|
}
|
|
|
|
|
|
} |