2019-09-06 11:04:28 +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 ="AccomplishmentConfig")
|
|
|
|
public class SAccomplishmentConfig implements BaseConfig {
|
|
|
|
|
|
|
|
private int id;
|
|
|
|
|
|
|
|
private int mapId;
|
|
|
|
|
|
|
|
private int logic;
|
|
|
|
|
|
|
|
private int[][] values;
|
|
|
|
|
|
|
|
private int score;
|
|
|
|
|
|
|
|
private int[] reward;
|
|
|
|
|
|
|
|
|
|
|
|
private int scheduleShow;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static Map<Integer, List<SAccomplishmentConfig>> sAccomplishmentConfigByMapIdMap;
|
|
|
|
private static Map<Integer,Map<Integer,List<SAccomplishmentConfig>>> sAccomplishmentConfigByMapIdAndLogicMap;
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void init() throws Exception {
|
2019-11-26 10:59:33 +08:00
|
|
|
sAccomplishmentConfigByMapIdMap = new HashMap<>();
|
|
|
|
sAccomplishmentConfigByMapIdAndLogicMap = new HashMap<>();
|
2019-09-06 11:04:28 +08:00
|
|
|
Map<Integer, SAccomplishmentConfig> config = STableManager.getConfig(SAccomplishmentConfig.class);
|
|
|
|
for(SAccomplishmentConfig sAccomplishmentConfig : config.values()){
|
|
|
|
int mapId = sAccomplishmentConfig.getMapId();
|
2019-11-25 17:11:21 +08:00
|
|
|
sAccomplishmentConfigByMapIdMap.computeIfAbsent(mapId,v->new ArrayList<>()).add(sAccomplishmentConfig);
|
|
|
|
sAccomplishmentConfigByMapIdAndLogicMap.computeIfAbsent(mapId,v->new HashMap<>());
|
|
|
|
sAccomplishmentConfigByMapIdAndLogicMap.get(mapId).computeIfAbsent(logic,v->new ArrayList<>()).add(sAccomplishmentConfig);
|
2019-09-06 11:04:28 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public static List<SAccomplishmentConfig> getsAccomplishmentConfigByMapIdAndLogic(int mapId,int logic) {
|
|
|
|
if(!sAccomplishmentConfigByMapIdAndLogicMap.containsKey(mapId)){
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
return sAccomplishmentConfigByMapIdAndLogicMap.get(mapId).get(logic);
|
|
|
|
}
|
|
|
|
|
|
|
|
public static List<SAccomplishmentConfig> getsAccomplishmentConfigByMapId(int mapId) {
|
|
|
|
return sAccomplishmentConfigByMapIdMap.get(mapId);
|
|
|
|
}
|
|
|
|
|
|
|
|
public int getId() {
|
|
|
|
return id;
|
|
|
|
}
|
|
|
|
|
|
|
|
public int getMapId() {
|
|
|
|
return mapId;
|
|
|
|
}
|
|
|
|
|
|
|
|
public int getLogic() {
|
|
|
|
return logic;
|
|
|
|
}
|
|
|
|
|
|
|
|
public int[][] getValues() {
|
|
|
|
return values;
|
|
|
|
}
|
|
|
|
|
|
|
|
public int getScore() {
|
|
|
|
return score;
|
|
|
|
}
|
|
|
|
|
|
|
|
public int[] getReward() {
|
|
|
|
return reward;
|
|
|
|
}
|
|
|
|
|
|
|
|
public int getScheduleShow() {
|
|
|
|
return scheduleShow;
|
|
|
|
}
|
|
|
|
}
|