47 lines
1.1 KiB
Java
47 lines
1.1 KiB
Java
|
|
package config;
|
||
|
|
|
||
|
|
import manager.STableManager;
|
||
|
|
import manager.Table;
|
||
|
|
|
||
|
|
import java.util.Map;
|
||
|
|
import java.util.TreeMap;
|
||
|
|
|
||
|
|
@Table(name ="GuildBossRewardConfig")
|
||
|
|
public class SGuildBossRewardConfig implements BaseConfig {
|
||
|
|
|
||
|
|
private int id;
|
||
|
|
|
||
|
|
private int damage;
|
||
|
|
|
||
|
|
private int[] reward;
|
||
|
|
|
||
|
|
private static TreeMap<Integer, SGuildBossRewardConfig> sGuildBossHurtRewardConfig;
|
||
|
|
|
||
|
|
|
||
|
|
@Override
|
||
|
|
public void init() throws Exception {
|
||
|
|
Map<Integer, SGuildBossRewardConfig> config = STableManager.getConfig(SGuildBossRewardConfig.class);
|
||
|
|
TreeMap<Integer, SGuildBossRewardConfig> sGuildBossHurtRewardConfigTmp = new TreeMap<>();
|
||
|
|
config.values().forEach(item ->sGuildBossHurtRewardConfigTmp.put(item.getDamage(),item));
|
||
|
|
sGuildBossHurtRewardConfig = sGuildBossHurtRewardConfigTmp;
|
||
|
|
}
|
||
|
|
|
||
|
|
public static SGuildBossRewardConfig getIndexByHurt(int hurtValue){
|
||
|
|
return sGuildBossHurtRewardConfig.lowerEntry(hurtValue).getValue();
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
public int getId() {
|
||
|
|
return id;
|
||
|
|
}
|
||
|
|
|
||
|
|
public int getDamage() {
|
||
|
|
return damage;
|
||
|
|
}
|
||
|
|
|
||
|
|
public int[] getReward() {
|
||
|
|
return reward;
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
}
|