miduo_server/tablemanager/src/main/java/config/SSpiritAnimalLevel.java

64 lines
1.4 KiB
Java
Raw Normal View History

2020-10-16 14:19:16 +08:00
package config;
import manager.STableManager;
import manager.Table;
2020-10-21 10:21:06 +08:00
import java.util.HashMap;
2020-10-16 14:19:16 +08:00
import java.util.Map;
@Table(name ="SpiritAnimalLevel")
public class SSpiritAnimalLevel implements BaseConfig {
private int id;
private int level;
private int quality;
private int[][] characterLevelPara;
private int[][] consume;
private int[][] sumConsume;
2020-10-19 19:58:52 +08:00
public static Map<Integer,Map<Integer,SSpiritAnimalLevel>> configByQualityAndLevel;
2020-10-16 14:19:16 +08:00
@Override
public void init() throws Exception {
2020-10-21 10:21:06 +08:00
Map<Integer,Map<Integer,SSpiritAnimalLevel>> tempConfigByQualityAndLevel = new HashMap<>();
Map<Integer, SSpiritAnimalLevel> config = STableManager.getConfig(SSpiritAnimalLevel.class);
for(Map.Entry<Integer,SSpiritAnimalLevel> entry:config.entrySet()){
SSpiritAnimalLevel value = entry.getValue();
tempConfigByQualityAndLevel.computeIfAbsent(value.getQuality(),n->new HashMap<>()).put(value.getLevel(),value);
}
configByQualityAndLevel = tempConfigByQualityAndLevel;
2020-10-16 14:19:16 +08:00
}
public int getId() {
return id;
}
public int getLevel() {
return level;
}
public int getQuality() {
return quality;
}
public int[][] getCharacterLevelPara() {
return characterLevelPara;
}
public int[][] getConsume() {
return consume;
}
public int[][] getSumConsume() {
return sumConsume;
}
}