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

62 lines
1.4 KiB
Java
Raw Normal View History

2022-03-18 11:50:59 +08:00
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 ="ExploreTask")
public class SExploreTask implements BaseConfig {
private int id;
private int type;
private int[][] values;
private int[][] reward;
public static Map<Integer, List<SExploreTask>> sTaskConfigByTypeMap;//<任务类型data>
@Override
public void init() throws Exception {
Map<Integer, SExploreTask> configTmp = STableManager.getConfig( SExploreTask.class);
Map<Integer, List<SExploreTask>> configListTmp = new HashMap<>();
for(SExploreTask sExploreTask : configTmp.values()){
int taskType = sExploreTask.getType();
if(!configListTmp.containsKey(taskType)){
configListTmp.put(taskType,new ArrayList<>());
}
configListTmp.get(taskType).add(sExploreTask);
}
sTaskConfigByTypeMap = configListTmp;
}
public static List<SExploreTask> getsTaskConfigByTypeMap(int missionType) {
return sTaskConfigByTypeMap.get(missionType);
}
public int getId() {
return id;
}
public int getType() {
return type;
}
public int[][] getValues() {
return values;
}
public int[][] getReward() {
return reward;
}
}