68 lines
1.4 KiB
Java
68 lines
1.4 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 ="TrialQuestionConfig")
|
|
public class STrialQuestionConfig implements BaseConfig {
|
|
|
|
private int id;
|
|
|
|
private int type;
|
|
|
|
private String answer;
|
|
|
|
private int[] trueAnswer;
|
|
|
|
private int[][] trueReward;
|
|
|
|
private int[][] falseReward;
|
|
|
|
public static Map<Integer,STrialQuestionConfig> sTrialQuestionConfigMap;
|
|
|
|
public static Map<Integer, List<STrialQuestionConfig>> questionConfigMapByType;
|
|
|
|
@Override
|
|
public void init() throws Exception {
|
|
sTrialQuestionConfigMap = STableManager.getConfig(STrialQuestionConfig.class);
|
|
Map<Integer, List<STrialQuestionConfig>> tempMap = new HashMap<>();
|
|
|
|
for(Map.Entry<Integer,STrialQuestionConfig> entry:sTrialQuestionConfigMap.entrySet()){
|
|
tempMap.computeIfAbsent(entry.getValue().getType(),n->new ArrayList<>()).add(entry.getValue());
|
|
}
|
|
questionConfigMapByType = tempMap;
|
|
|
|
}
|
|
|
|
|
|
public int getId() {
|
|
return id;
|
|
}
|
|
|
|
public int getType() {
|
|
return type;
|
|
}
|
|
|
|
public String getAnswer() {
|
|
return answer;
|
|
}
|
|
|
|
public int[] getTrueAnswer() {
|
|
return trueAnswer;
|
|
}
|
|
|
|
public int[][] getTrueReward() {
|
|
return trueReward;
|
|
}
|
|
|
|
public int[][] getFalseReward() {
|
|
return falseReward;
|
|
}
|
|
|
|
|
|
} |