75 lines
1.5 KiB
Java
75 lines
1.5 KiB
Java
package config;
|
|
|
|
import manager.STableManager;
|
|
import manager.Table;
|
|
|
|
import java.util.HashMap;
|
|
import java.util.Map;
|
|
import java.util.TreeMap;
|
|
|
|
@Table(name ="GemConfig")
|
|
public class SGemConfig implements BaseConfig {
|
|
|
|
private int id;
|
|
|
|
private int quality;
|
|
|
|
private int type;
|
|
|
|
private int level;
|
|
|
|
private int[][] property;
|
|
|
|
private int upgradeNum;
|
|
|
|
private int[] upgradeCost;
|
|
|
|
private int nextGem;
|
|
|
|
public static TreeMap<Integer, TreeMap<Integer,SGemConfig>>gemConfigMapByType;
|
|
|
|
@Override
|
|
public void init() throws Exception {
|
|
gemConfigMapByType=new TreeMap<>();
|
|
Map<Integer, SGemConfig> config = STableManager.getConfig(SGemConfig.class);
|
|
for(SGemConfig sGemConfig : config.values()){
|
|
if (!gemConfigMapByType.containsKey(sGemConfig.getType())){
|
|
TreeMap<Integer,SGemConfig>lvMap=new TreeMap<>();
|
|
gemConfigMapByType.put(sGemConfig.getType(),lvMap);
|
|
}
|
|
gemConfigMapByType.get(sGemConfig.getType()).put(sGemConfig.getLevel(),sGemConfig);
|
|
}
|
|
}
|
|
|
|
public int getId() {
|
|
return id;
|
|
}
|
|
|
|
public int getQuality() {
|
|
return quality;
|
|
}
|
|
|
|
public int getType() {
|
|
return type;
|
|
}
|
|
|
|
public int getLevel() {
|
|
return level;
|
|
}
|
|
|
|
public int[][] getProperty() {
|
|
return property;
|
|
}
|
|
|
|
public int getUpgradeNum() {
|
|
return upgradeNum;
|
|
}
|
|
|
|
public int[] getUpgradeCost() {
|
|
return upgradeCost;
|
|
}
|
|
|
|
public int getNextGem() {
|
|
return nextGem;
|
|
}
|
|
} |