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

70 lines
1.6 KiB
Java
Raw Normal View History

package config;
2019-09-26 09:54:17 +08:00
import manager.STableManager;
import manager.Table;
2019-09-26 09:54:17 +08:00
2019-10-19 16:49:38 +08:00
import java.util.HashMap;
2019-09-26 09:54:17 +08:00
import java.util.Map;
@Table(name ="TreasureSunlongConfig")
public class STreasureSunlongConfig implements BaseConfig {
2019-10-19 16:49:38 +08:00
private int id;
2019-09-26 09:54:17 +08:00
2019-10-19 16:49:38 +08:00
private int activityId;
2019-09-26 09:54:17 +08:00
2019-10-19 16:49:38 +08:00
private int type;
2019-09-26 09:54:17 +08:00
2019-10-19 16:49:38 +08:00
private int level;
2019-09-26 09:54:17 +08:00
2019-10-19 16:49:38 +08:00
private int[][] integral;
2019-09-26 09:54:17 +08:00
2019-10-19 16:49:38 +08:00
private int[][] reward;
2019-09-26 09:54:17 +08:00
2019-10-19 16:49:38 +08:00
private int[][] treasureReward;
2019-09-26 09:54:17 +08:00
2019-10-19 16:49:38 +08:00
public static Map<Integer,STreasureSunlongConfig> treasureSunlongConfigMap;
2020-02-28 12:04:02 +08:00
public static Map<Integer,Map<Integer,STreasureSunlongConfig>> levelTreasureConfigMap;
2019-10-19 16:49:38 +08:00
@Override
2019-09-26 09:54:17 +08:00
public void init() throws Exception {
2019-10-14 15:30:13 +08:00
treasureSunlongConfigMap= STableManager.getConfig(STreasureSunlongConfig.class);
2020-02-28 12:04:02 +08:00
levelTreasureConfigMap= new HashMap<>();
2019-10-19 16:49:38 +08:00
for(Map.Entry<Integer,STreasureSunlongConfig> entry:treasureSunlongConfigMap.entrySet()){
STreasureSunlongConfig config = entry.getValue();
2020-02-28 12:04:02 +08:00
// levelTreasureConfigMap.put(config.getLevel(), config);
levelTreasureConfigMap.computeIfAbsent(config.getActivityId(),k->new HashMap<>()).put(config.getLevel(),config);
2019-10-19 16:49:38 +08:00
}
2019-09-26 09:54:17 +08:00
}
2019-10-19 16:49:38 +08:00
public int getId() {
2019-09-26 09:54:17 +08:00
return id;
}
2019-10-19 16:49:38 +08:00
public int getActivityId() {
2019-09-26 09:54:17 +08:00
return activityId;
}
2019-10-19 16:49:38 +08:00
public int getType() {
2019-09-26 09:54:17 +08:00
return type;
}
2019-10-19 16:49:38 +08:00
public int getLevel() {
2019-09-26 09:54:17 +08:00
return level;
}
2019-10-19 16:49:38 +08:00
public int[][] getIntegral() {
2019-09-26 09:54:17 +08:00
return integral;
}
2019-10-19 16:49:38 +08:00
public int[][] getReward() {
2019-09-26 09:54:17 +08:00
return reward;
}
2019-10-19 16:49:38 +08:00
public int[][] getTreasureReward() {
2019-09-26 09:54:17 +08:00
return treasureReward;
}
}