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

81 lines
2.0 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
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Table(name ="TreasureSunlongTaskConfig")
public class STreasureSunlongTaskConfig implements BaseConfig {
private int id;
private int activityId;
private int type;
private int taskType;
private int[][] taskValue;
private int[][] integral;
private int weight;
public static Map<Integer,STreasureSunlongTaskConfig> treasureTaskConfig;
public static Map<Integer, List<Integer>> taskTypeMap;
2019-10-10 10:04:02 +08:00
public static Map<Integer,List<STreasureSunlongTaskConfig>> sTreasureTaskConfigListByTypeMapTmp;
2019-09-26 09:54:17 +08:00
@Override
public void init() throws Exception {
treasureTaskConfig = STableManager.getConfig(STreasureSunlongTaskConfig.class);
taskTypeMap = new HashMap<>();
2019-10-10 10:04:02 +08:00
sTreasureTaskConfigListByTypeMapTmp = new HashMap<>();
2019-09-26 09:54:17 +08:00
for(Map.Entry<Integer,STreasureSunlongTaskConfig> entry:treasureTaskConfig.entrySet()){
2019-10-10 10:04:02 +08:00
STreasureSunlongTaskConfig entryValue = entry.getValue();
if(!taskTypeMap.containsKey(entryValue.getType())){
taskTypeMap.put(entryValue.getType(),new ArrayList<>());
}
if(!sTreasureTaskConfigListByTypeMapTmp.containsKey(entryValue.getTaskType())){
sTreasureTaskConfigListByTypeMapTmp.put(entryValue.getTaskType(),new ArrayList<>());
2019-09-26 09:54:17 +08:00
}
2019-10-10 10:04:02 +08:00
sTreasureTaskConfigListByTypeMapTmp.get(entryValue.getTaskType()).add(entryValue);
taskTypeMap.get(entryValue.getType()).add(entry.getKey());
2019-09-26 09:54:17 +08:00
}
}
public int getId() {
return id;
}
public int getActivityId() {
return activityId;
}
public int getType() {
return type;
}
public int getTaskType() {
return taskType;
}
public int[][] getTaskValue() {
return taskValue;
}
public int[][] getIntegral() {
return integral;
}
public int getWeight() {
return weight;
}
}