71 lines
1.3 KiB
Java
71 lines
1.3 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 ="TrialGameConfig")
|
|
public class STrialGameConfig implements BaseConfig {
|
|
|
|
private int id;
|
|
|
|
private int type;
|
|
|
|
private int rewardID;
|
|
|
|
private int weight;
|
|
|
|
private int min;
|
|
|
|
private int max;
|
|
|
|
private int unlockLv;
|
|
|
|
public static Map<Integer,STrialGameConfig> trialGameConfigMap;
|
|
|
|
public static Map<Integer, List<STrialGameConfig>> trialGameMapByType;
|
|
|
|
@Override
|
|
public void init() throws Exception {
|
|
trialGameConfigMap = STableManager.getConfig(STrialGameConfig.class);
|
|
Map<Integer, List<STrialGameConfig>> tempMap = new HashMap<>();
|
|
|
|
for(Map.Entry<Integer,STrialGameConfig> entry:trialGameConfigMap.entrySet()){
|
|
tempMap.computeIfAbsent(entry.getValue().getType(),n->new ArrayList<>()).add(entry.getValue());
|
|
}
|
|
trialGameMapByType = tempMap;
|
|
}
|
|
|
|
|
|
public int getId() {
|
|
return id;
|
|
}
|
|
|
|
public int getType() {
|
|
return type;
|
|
}
|
|
|
|
public int getRewardID() {
|
|
return rewardID;
|
|
}
|
|
|
|
public int getWeight() {
|
|
return weight;
|
|
}
|
|
|
|
public int getMin() {
|
|
return min;
|
|
}
|
|
|
|
public int getMax() {
|
|
return max;
|
|
}
|
|
|
|
public int getUnlockLv() {
|
|
return unlockLv;
|
|
}
|
|
} |