2021-03-25 14:07:35 +08:00
|
|
|
|
package config;
|
|
|
|
|
|
|
|
|
|
import manager.STableManager;
|
|
|
|
|
import manager.Table;
|
|
|
|
|
|
2022-01-18 10:06:09 +08:00
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
import java.util.List;
|
2021-03-25 14:07:35 +08:00
|
|
|
|
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;
|
|
|
|
|
|
2022-09-06 13:45:24 +08:00
|
|
|
|
// key:活动id
|
|
|
|
|
private static Map<Integer, Map<Integer,SArroGantFly>> activityMap = new HashMap<>();
|
|
|
|
|
// key: 任务类型
|
|
|
|
|
private static Map<Integer, Map<Integer,SArroGantFly>> taskTypeMap = new HashMap<>();
|
|
|
|
|
|
2021-03-25 14:07:35 +08:00
|
|
|
|
@Override
|
|
|
|
|
public void init() throws Exception {
|
2022-01-18 10:06:09 +08:00
|
|
|
|
Map<Integer, SArroGantFly> config = STableManager.getConfig(SArroGantFly.class);
|
2022-09-06 13:45:24 +08:00
|
|
|
|
HashMap<Integer, Map<Integer,SArroGantFly>> map1 = new HashMap<>();
|
|
|
|
|
HashMap<Integer, Map<Integer,SArroGantFly>> map2 = new HashMap<>();
|
2022-01-18 10:06:09 +08:00
|
|
|
|
for (SArroGantFly value : config.values()) {
|
2022-09-06 13:45:24 +08:00
|
|
|
|
// 活动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);
|
2022-01-18 10:06:09 +08:00
|
|
|
|
}
|
2022-09-06 13:45:24 +08:00
|
|
|
|
activityMap.clear();
|
|
|
|
|
activityMap = map1;
|
|
|
|
|
|
|
|
|
|
taskTypeMap.clear();
|
|
|
|
|
taskTypeMap = map2;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static Map<Integer, Map<Integer,SArroGantFly>> getActivityMap() {
|
|
|
|
|
return activityMap;
|
2021-03-25 14:07:35 +08:00
|
|
|
|
}
|
|
|
|
|
|
2022-09-06 13:45:24 +08:00
|
|
|
|
public static Map<Integer, Map<Integer, SArroGantFly>> getTaskTypeMap() {
|
|
|
|
|
return taskTypeMap;
|
2022-01-18 10:06:09 +08:00
|
|
|
|
}
|
2021-03-25 14:07:35 +08:00
|
|
|
|
|
2022-01-18 10:06:09 +08:00
|
|
|
|
public int getId() {
|
2021-03-25 14:07:35 +08:00
|
|
|
|
return id;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public int getActivityId() {
|
|
|
|
|
return activityId;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public int getValues() {
|
|
|
|
|
return values;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public int[][] getValuesII() {
|
|
|
|
|
return valuesII;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public int[][] getReward() {
|
|
|
|
|
return reward;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|