工会boss奖励

back_recharge
wangyuan 2020-01-15 10:23:18 +08:00
parent fa7534ce86
commit fe4f9c64e5
1 changed files with 43 additions and 0 deletions

View File

@ -17,12 +17,39 @@ public class SGuildBossRewardConfig implements BaseConfig {
private int[][] randomReward;
private int[][][] randomRewardAllGroup;
private static TreeMap<Integer, SGuildBossRewardConfig> sGuildBossHurtRewardConfig;
@Override
public void init() throws Exception {
Map<Integer, SGuildBossRewardConfig> config = STableManager.getConfig(SGuildBossRewardConfig.class);
for(SGuildBossRewardConfig sGuildBossRewardConfig : config.values()){
int[] reward = sGuildBossRewardConfig.getReward();
int prelength=0;
int[] preReward=null;
int[][][] randomRewardAllGroupTmpPre=null;
if(sGuildBossRewardConfig.getId()!=1){
SGuildBossRewardConfig sGuildBossRewardConfigPre = config.get(sGuildBossRewardConfig.getId() - 1);
preReward=sGuildBossRewardConfigPre.getReward();
randomRewardAllGroupTmpPre=sGuildBossRewardConfigPre.getRandomRewardAllGroup();
prelength = preReward.length;
}
int rewardFinl[] = new int[reward.length+prelength];
System.arraycopy(reward,0,rewardFinl,0,reward.length);
sGuildBossRewardConfig.setReward(rewardFinl);
int[][][] randomRewardAllGroupTmp = new int[sGuildBossRewardConfig.getId()][][];
randomRewardAllGroupTmp[0] =sGuildBossRewardConfig.getRandomReward();
if(prelength>0){
System.arraycopy(preReward,0,rewardFinl,reward.length,preReward.length);
System.arraycopy(randomRewardAllGroupTmpPre,0,randomRewardAllGroupTmp,1,preReward.length);
}
sGuildBossRewardConfig.setRandomRewardAllGroup(randomRewardAllGroupTmp);
}
TreeMap<Integer, SGuildBossRewardConfig> sGuildBossHurtRewardConfigTmp = new TreeMap<>();
config.values().forEach(item ->sGuildBossHurtRewardConfigTmp.put(item.getDamage(),item));
sGuildBossHurtRewardConfig = sGuildBossHurtRewardConfigTmp;
@ -48,4 +75,20 @@ public class SGuildBossRewardConfig implements BaseConfig {
public int[][] getRandomReward() {
return randomReward;
}
public void setReward(int[] reward) {
this.reward = reward;
}
public void setRandomReward(int[][] randomReward) {
this.randomReward = randomReward;
}
public int[][][] getRandomRewardAllGroup() {
return randomRewardAllGroup;
}
public void setRandomRewardAllGroup(int[][][] randomRewardAllGroup) {
this.randomRewardAllGroup = randomRewardAllGroup;
}
}