80 lines
2.0 KiB
Java
80 lines
2.0 KiB
Java
package config;
|
||
|
||
import manager.STableManager;
|
||
import manager.Table;
|
||
|
||
import java.util.ArrayList;
|
||
import java.util.HashMap;
|
||
import java.util.List;
|
||
import java.util.Map;
|
||
|
||
@Table(name ="ArroGantFly")
|
||
public class SArroGantFly implements BaseConfig {
|
||
|
||
private int id;
|
||
|
||
private int activityId;
|
||
|
||
private int values;
|
||
|
||
private int[][] valuesII;
|
||
|
||
private int[][] reward;
|
||
|
||
// key:活动id
|
||
private static Map<Integer, Map<Integer,SArroGantFly>> activityMap = new HashMap<>();
|
||
// key: 任务类型
|
||
private static Map<Integer, Map<Integer,SArroGantFly>> taskTypeMap = new HashMap<>();
|
||
|
||
@Override
|
||
public void init() throws Exception {
|
||
Map<Integer, SArroGantFly> config = STableManager.getConfig(SArroGantFly.class);
|
||
HashMap<Integer, Map<Integer,SArroGantFly>> map1 = new HashMap<>();
|
||
HashMap<Integer, Map<Integer,SArroGantFly>> map2 = new HashMap<>();
|
||
for (SArroGantFly value : config.values()) {
|
||
// 活动id
|
||
Map<Integer, SArroGantFly> flyMap = map1.getOrDefault(value.getActivityId(), new HashMap<>());
|
||
flyMap.put(value.getId(),value);
|
||
map1.put(value.getActivityId(),flyMap);
|
||
// 任务类型
|
||
Map<Integer, SArroGantFly> flyMap2 = map2.getOrDefault(value.getValues(), new HashMap<>());
|
||
flyMap2.put(value.getId(),value);
|
||
map2.put(value.getValues(),flyMap2);
|
||
}
|
||
activityMap.clear();
|
||
activityMap = map1;
|
||
|
||
taskTypeMap.clear();
|
||
taskTypeMap = map2;
|
||
}
|
||
|
||
public static Map<Integer, Map<Integer,SArroGantFly>> getActivityMap() {
|
||
return activityMap;
|
||
}
|
||
|
||
public static Map<Integer, Map<Integer, SArroGantFly>> getTaskTypeMap() {
|
||
return taskTypeMap;
|
||
}
|
||
|
||
public int getId() {
|
||
return id;
|
||
}
|
||
|
||
public int getActivityId() {
|
||
return activityId;
|
||
}
|
||
|
||
public int getValues() {
|
||
return values;
|
||
}
|
||
|
||
public int[][] getValuesII() {
|
||
return valuesII;
|
||
}
|
||
|
||
public int[][] getReward() {
|
||
return reward;
|
||
}
|
||
|
||
|
||
} |