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

62 lines
1.4 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

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;
}
}