车迟斗法优化,根据boss更换排行奖励
parent
9cc7bf8588
commit
0c4041c74d
|
@ -44,9 +44,14 @@ public class CarDelayFunction implements FunctionManager {
|
|||
|
||||
@Override
|
||||
public void closeAction() throws Exception {
|
||||
Map<Integer, TreeMap<Integer, String>> rewardByTypeAndRankMap = SWorldBossRewardConfig.rewardByTypeAndRankMap;
|
||||
// 获取车迟斗法当前boss的索引id
|
||||
int indexId = GuildFightLogic.carDelayProgressIndication.getBossIndexId();
|
||||
// 根据索引id取出当前的奖励配置
|
||||
Map<Integer, TreeMap<Integer, String>> rewardByTypeAndRankMap = SWorldBossRewardConfig.rewardByBossIdMap.get(indexId);
|
||||
|
||||
TreeMap<Integer, String> personRewardConfigTreeMap = rewardByTypeAndRankMap.get(2);
|
||||
TreeMap<Integer, String> guildRewardConfigTreeMap = rewardByTypeAndRankMap.get(1);
|
||||
|
||||
Set<ZSetOperations.TypedTuple<String>> personRangeWithScores = RedisUtil.getInstence().getZsetreverseRangeWithScores(RedisKey.CAR_DEALY_RANK, "", 0, -1);
|
||||
int rank=0;
|
||||
String personTitle = SErrorCodeEerverConfig.getI18NMessage("family_fight_rank_personreward_title");
|
||||
|
|
|
@ -19,23 +19,36 @@ public class SWorldBossRewardConfig implements BaseConfig {
|
|||
|
||||
private int type;
|
||||
|
||||
public static Map<Integer, TreeMap<Integer,String>> rewardByTypeAndRankMap = new HashMap<>();
|
||||
private int bossId;
|
||||
|
||||
/**
|
||||
* 类型,排名,奖励
|
||||
*/
|
||||
public static Map<Integer,TreeMap<Integer,String>> rewardByTypeAndRankMap = new HashMap<>();
|
||||
/**
|
||||
* boss索引id,类型,排名,奖励
|
||||
*/
|
||||
public static Map<Integer,TreeMap<Integer, TreeMap<Integer,String>>> rewardByBossIdMap = new HashMap<>();
|
||||
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
Map<Integer, SWorldBossRewardConfig> config = STableManager.getConfig(SWorldBossRewardConfig.class);
|
||||
Map<Integer, TreeMap<Integer,String>> rewardByTypeAndRankMapTmp = new HashMap<>();
|
||||
Map<Integer, TreeMap<Integer,String>> rewardByTypeAndRankMapTmp = new HashMap<>();
|
||||
Map<Integer,TreeMap<Integer, TreeMap<Integer,String>>> rewardByBossIdMapTmp = new HashMap<>();
|
||||
config.forEach((id,item)->{
|
||||
rewardByTypeAndRankMapTmp.putIfAbsent(item.getType(),new TreeMap<>());
|
||||
rewardByTypeAndRankMapTmp.get(item.getType()).put(item.getSection()[0], StringUtil.parseArrayToString(item.getReward()));
|
||||
});
|
||||
rewardByTypeAndRankMap = rewardByTypeAndRankMapTmp;
|
||||
|
||||
rewardByBossIdMapTmp.putIfAbsent(item.getBossId(),new TreeMap<>());
|
||||
rewardByBossIdMapTmp.get(item.getBossId()).putIfAbsent(item.getType(),new TreeMap<>());
|
||||
rewardByBossIdMapTmp.get(item.getBossId()).get(item.getType()).put(item.getSection()[0], StringUtil.parseArrayToString(item.getReward()));
|
||||
});
|
||||
|
||||
rewardByTypeAndRankMap = rewardByTypeAndRankMapTmp;
|
||||
rewardByBossIdMap = rewardByBossIdMapTmp;
|
||||
}
|
||||
|
||||
|
||||
public int getId() {
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
|
@ -50,4 +63,8 @@ public class SWorldBossRewardConfig implements BaseConfig {
|
|||
public int getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public int getBossId() {
|
||||
return bossId;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue