心愿修改
parent
614dbffcf4
commit
615fd8df01
|
@ -53,7 +53,10 @@ public class DrawLvChestActivity extends AbstractActivity {
|
|||
if (activityMission == null || activity == null){
|
||||
return missionInfo;
|
||||
}
|
||||
Map<Integer, SWishConfig> map = SWishConfig.map;
|
||||
Map<Integer, SWishConfig> map = SWishConfig.typeMap.get(activity.getLotteryType());
|
||||
if (map == null){
|
||||
return missionInfo;
|
||||
}
|
||||
int count = user.getHeroManager().getCountByDraw(activity.getLotteryType());
|
||||
Map<Integer, ActivityProgressInfo> progressInfoMap = activityMission.getActivityMissionMap();
|
||||
for (SWishConfig config : map.values()) {
|
||||
|
|
|
@ -3,6 +3,7 @@ package config;
|
|||
import manager.STableManager;
|
||||
import manager.Table;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@Table(name ="WishConfig")
|
||||
|
@ -10,6 +11,10 @@ public class SWishConfig implements BaseConfig {
|
|||
|
||||
private int id;
|
||||
|
||||
private int level;
|
||||
|
||||
private int lotteryType;
|
||||
|
||||
private int drawCardNumber;
|
||||
|
||||
private int[][] reward;
|
||||
|
@ -17,10 +22,17 @@ public class SWishConfig implements BaseConfig {
|
|||
private int weight;
|
||||
|
||||
public static Map<Integer, SWishConfig> map;
|
||||
|
||||
public static Map<Integer, Map<Integer, SWishConfig>> typeMap = new HashMap<>();
|
||||
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
map = STableManager.getConfig(SWishConfig.class);
|
||||
for (SWishConfig value : map.values()) {
|
||||
Map<Integer, SWishConfig> configMap = typeMap.getOrDefault(value.getLotteryType(), new HashMap<>());
|
||||
configMap.put(value.id,value);
|
||||
typeMap.put(value.getLotteryType(), configMap);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -28,7 +40,15 @@ public class SWishConfig implements BaseConfig {
|
|||
return id;
|
||||
}
|
||||
|
||||
public int getDrawCardNumber() {
|
||||
public int getLevel() {
|
||||
return level;
|
||||
}
|
||||
|
||||
public int getLotteryType() {
|
||||
return lotteryType;
|
||||
}
|
||||
|
||||
public int getDrawCardNumber() {
|
||||
return drawCardNumber;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue