牛气冲天任务优化
parent
351909d5f3
commit
3e3e5ee1bf
|
@ -9,6 +9,7 @@ import manager.STableManager;
|
|||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
public class CowFlySkyMissionType extends AbstractMissionType {
|
||||
|
@ -33,9 +34,11 @@ public class CowFlySkyMissionType extends AbstractMissionType {
|
|||
public void calCumulationDataResult(User user, CumulationData.Result result, List<MissionStateChangeInfo> missionStateChangeInfos, CumulationData cumulationData) throws Exception {
|
||||
// 进行中得任务
|
||||
Set<Integer> doingMissionIds = getDoingMissionIds();
|
||||
|
||||
Collection<SArroGantFly> values = STableManager.getConfig(SArroGantFly.class).values();
|
||||
for (SArroGantFly fly : values) {
|
||||
List<SArroGantFly> flyList = SArroGantFly.getMap().get(result.subType.getMissionTypeValue());
|
||||
if (flyList == null){
|
||||
return;
|
||||
}
|
||||
for (SArroGantFly fly : flyList) {
|
||||
// 任务子id
|
||||
int id = fly.getId();
|
||||
// 不在执行中
|
||||
|
|
|
@ -3,6 +3,9 @@ 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 ="ArroGantFly")
|
||||
|
@ -18,14 +21,23 @@ public class SArroGantFly implements BaseConfig {
|
|||
|
||||
private int[][] reward;
|
||||
|
||||
private static Map<Integer, List<SArroGantFly>> map = new HashMap<>();
|
||||
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
|
||||
Map<Integer, SArroGantFly> config = STableManager.getConfig(SArroGantFly.class);
|
||||
for (SArroGantFly value : config.values()) {
|
||||
List<SArroGantFly> flyList = map.getOrDefault(value.getValues(), new ArrayList<>());
|
||||
flyList.add(value);
|
||||
map.put(value.getValues(),flyList);
|
||||
}
|
||||
}
|
||||
|
||||
public static Map<Integer, List<SArroGantFly>> getMap() {
|
||||
return map;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue