87 lines
2.1 KiB
Java
87 lines
2.1 KiB
Java
package config;
|
|
|
|
import manager.STableManager;
|
|
import manager.Table;
|
|
|
|
import java.util.HashMap;
|
|
import java.util.Map;
|
|
import java.util.TreeMap;
|
|
|
|
@Table(name ="LikeAbility")
|
|
public class SLikeAbilityConfig implements BaseConfig {
|
|
|
|
private int id;
|
|
|
|
private int type;
|
|
|
|
private int level;
|
|
|
|
private int favorDegree;
|
|
|
|
private int[][] property;
|
|
|
|
private int[][] privilegeProperty;
|
|
|
|
private int[] skill;
|
|
|
|
public static Map<Integer, SLikeAbilityConfig> sLikeAbilityConfigMap;
|
|
|
|
public static Map<Integer, SLikeAbilityConfig> heroLikeAbilityConfigMap;
|
|
public static Map<Integer, Integer> heroLikeAbilityByLevel;
|
|
|
|
public static Map<Integer, SLikeAbilityConfig> allLikeAbilityConfigMap;
|
|
public static Map<Integer, Integer> allLikeAbilityByLevel;
|
|
|
|
|
|
@Override
|
|
public void init() throws Exception {
|
|
heroLikeAbilityConfigMap=new HashMap<>();
|
|
allLikeAbilityConfigMap=new HashMap<>();
|
|
heroLikeAbilityByLevel=new TreeMap<>();
|
|
allLikeAbilityByLevel=new TreeMap<>();
|
|
sLikeAbilityConfigMap = STableManager.getConfig(SLikeAbilityConfig.class);
|
|
int heroLike=0;
|
|
int allLike=0;
|
|
for (SLikeAbilityConfig value : sLikeAbilityConfigMap.values()) {
|
|
if (value.type==1){
|
|
allLikeAbilityConfigMap.put(value.level,value);
|
|
allLike+=value.getFavorDegree();
|
|
allLikeAbilityByLevel.put(value.level,allLike);
|
|
}else {
|
|
heroLikeAbilityConfigMap.put(value.level,value);
|
|
heroLike+=value.getFavorDegree();
|
|
heroLikeAbilityByLevel.put(value.level,heroLike);
|
|
}
|
|
}
|
|
}
|
|
|
|
public int getId() {
|
|
return id;
|
|
}
|
|
|
|
public int getType() {
|
|
return type;
|
|
}
|
|
|
|
public int getLevel() {
|
|
return level;
|
|
}
|
|
|
|
public int getFavorDegree() {
|
|
return favorDegree;
|
|
}
|
|
|
|
public int[][] getProperty() {
|
|
return property;
|
|
}
|
|
|
|
public int[][] getPrivilegeProperty() {
|
|
return privilegeProperty;
|
|
}
|
|
|
|
public int[] getSkill() {
|
|
return skill;
|
|
}
|
|
}
|
|
|