90 lines
2.7 KiB
Java
90 lines
2.7 KiB
Java
package config;
|
|
|
|
import manager.STableManager;
|
|
import manager.Table;
|
|
|
|
import java.util.HashMap;
|
|
import java.util.Map;
|
|
|
|
@Table(name ="PropertyConfig")
|
|
public class SPropertyConfig implements BaseConfig {
|
|
|
|
private int propertyId;
|
|
|
|
private int style;
|
|
|
|
private float score;
|
|
|
|
private int targetPropertyId;
|
|
|
|
private int ifFormula;
|
|
|
|
private int propertyIdInBattle;
|
|
|
|
|
|
private static Map<Integer,SPropertyConfig> sPropertyConfigByPIDMap;
|
|
private static Map<Integer,SPropertyConfig> sPropertyIConfigByInBattleMap;
|
|
private static Map<Integer,SPropertyConfig> sPropertyConfigByTargetMap;
|
|
|
|
|
|
@Override
|
|
public void init() throws Exception {
|
|
Map<Integer,SPropertyConfig> sPropertyConfigByPIDMapTmp = new HashMap<>();
|
|
Map<Integer,SPropertyConfig> sPropertyIConfigByInBattleMapTmp = new HashMap<>();
|
|
Map<Integer,SPropertyConfig> sPropertyConfigByTargetMapTmp = new HashMap<>();
|
|
Map<Integer, SPropertyConfig> config = STableManager.getConfig(SPropertyConfig.class);
|
|
for(SPropertyConfig sPropertyConfig : config.values()){
|
|
int propertyId = sPropertyConfig.getPropertyId();
|
|
sPropertyConfigByPIDMapTmp.put(propertyId,sPropertyConfig);
|
|
int propertyIdInBattle = sPropertyConfig.getPropertyIdInBattle();
|
|
if(propertyIdInBattle!=0){
|
|
sPropertyIConfigByInBattleMapTmp.put(propertyIdInBattle,sPropertyConfig);
|
|
}
|
|
int targetPropertyId = sPropertyConfig.getTargetPropertyId();
|
|
if(targetPropertyId!=0){
|
|
sPropertyConfigByTargetMapTmp.put(targetPropertyId,sPropertyConfig);
|
|
}
|
|
}
|
|
sPropertyConfigByPIDMap = sPropertyConfigByPIDMapTmp;
|
|
sPropertyIConfigByInBattleMap = sPropertyIConfigByInBattleMapTmp;
|
|
sPropertyConfigByTargetMap = sPropertyConfigByTargetMapTmp;
|
|
|
|
}
|
|
|
|
public static SPropertyConfig getsPropertyConfigByPID(int propertyId) {
|
|
return sPropertyConfigByPIDMap.get(propertyId);
|
|
}
|
|
|
|
public static SPropertyConfig getsPropertyConfigByBattlePID(int battlePropertyId) {
|
|
return sPropertyIConfigByInBattleMap .get(battlePropertyId);
|
|
}
|
|
|
|
public static SPropertyConfig getsPropertyConfigByTargetPropertyId(int targetPropertyId) {
|
|
return sPropertyConfigByTargetMap.get(targetPropertyId);
|
|
}
|
|
|
|
|
|
public int getPropertyId() {
|
|
return propertyId;
|
|
}
|
|
|
|
public int getStyle() {
|
|
return style;
|
|
}
|
|
|
|
public float getScore() {
|
|
return score;
|
|
}
|
|
|
|
public int getTargetPropertyId() {
|
|
return targetPropertyId;
|
|
}
|
|
|
|
public int getIfFormula() {
|
|
return ifFormula;
|
|
}
|
|
|
|
public int getPropertyIdInBattle() {
|
|
return propertyIdInBattle;
|
|
}
|
|
} |