142 lines
3.2 KiB
Java
142 lines
3.2 KiB
Java
package config;
|
|
|
|
import manager.STableManager;
|
|
import manager.Table;
|
|
import rpc.protocols.CommonProto;
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.HashMap;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
|
|
@Table(name ="ArenaRobotConfig")
|
|
public class SArenaRobotConfig implements BaseConfig {
|
|
|
|
private int id;
|
|
|
|
private String robotName;
|
|
|
|
private int robotScore;
|
|
private int robotLevel;
|
|
|
|
private int[] roleId;
|
|
|
|
private List<Integer> heroList;
|
|
|
|
private int roleLv;
|
|
|
|
private int[] differDemonsId;
|
|
|
|
private int differDemonsLv;
|
|
|
|
private int poolId;
|
|
|
|
private int totalForce;
|
|
|
|
private int breakId;
|
|
|
|
private int starBreakId;
|
|
|
|
private Map<Integer,Integer> starOfHeroMap;
|
|
|
|
private Map<Integer, CommonProto.Hero> heroMapList;
|
|
|
|
private static Map<Integer, List<SArenaRobotConfig>> sArenaRobotConfigByPoolMap;
|
|
|
|
private static Map<Integer, SArenaRobotConfig> sArenaRobotConfigMap;
|
|
|
|
|
|
@Override
|
|
public void init() throws Exception {
|
|
Map<Integer, List<SArenaRobotConfig>> result = new HashMap<>();
|
|
Map<Integer, SArenaRobotConfig> config = STableManager.getConfig(SArenaRobotConfig.class);
|
|
for(SArenaRobotConfig sArenaRobotConfig : config.values()){
|
|
int poolId = sArenaRobotConfig.getPoolId();
|
|
if(!result.containsKey(poolId)){
|
|
result.put(poolId,new ArrayList<>());
|
|
}
|
|
int[] roleId = sArenaRobotConfig.getRoleId();
|
|
List<Integer> heroListTmp = new ArrayList<>(roleId.length);
|
|
for(int heroId : roleId){
|
|
heroListTmp.add(heroId);
|
|
}
|
|
sArenaRobotConfig.setHeroList(heroListTmp);
|
|
result.get(poolId).add(sArenaRobotConfig);
|
|
}
|
|
sArenaRobotConfigByPoolMap = result;
|
|
sArenaRobotConfigMap = config;
|
|
|
|
}
|
|
|
|
public static List<SArenaRobotConfig> getSArenaRobotConfigsByPool( int poolId) {
|
|
return sArenaRobotConfigByPoolMap.get(poolId);
|
|
}
|
|
|
|
public static Map<Integer, SArenaRobotConfig> getsArenaRobotConfigMap() {
|
|
return sArenaRobotConfigMap;
|
|
}
|
|
|
|
public static SArenaRobotConfig getsArenaRobotConfigById(int id) {
|
|
return sArenaRobotConfigMap.get(id);
|
|
}
|
|
|
|
public int getId() {
|
|
return id;
|
|
}
|
|
|
|
public String getRobotName() {
|
|
return robotName;
|
|
}
|
|
|
|
public int getRobotScore() {
|
|
return robotScore;
|
|
}
|
|
|
|
private int[] getRoleId() {
|
|
return roleId;
|
|
}
|
|
|
|
public int getRoleLv() {
|
|
return roleLv;
|
|
}
|
|
|
|
public int[] getDifferDemonsId() {
|
|
return differDemonsId;
|
|
}
|
|
|
|
public int getDifferDemonsLv() {
|
|
return differDemonsLv;
|
|
}
|
|
|
|
public int getPoolId() {
|
|
return poolId;
|
|
}
|
|
|
|
public List<Integer> getHeroList() {
|
|
return heroList;
|
|
}
|
|
|
|
public void setHeroList(List<Integer> heroList) {
|
|
this.heroList = heroList;
|
|
}
|
|
|
|
public int getTotalForce() {
|
|
return totalForce;
|
|
}
|
|
|
|
public void setTotalForce(int totalForce) {
|
|
this.totalForce = totalForce;
|
|
}
|
|
|
|
public int getRobotLevel() {
|
|
return robotLevel;
|
|
}
|
|
|
|
public Map<Integer, CommonProto.Hero> getHeroMapList() {
|
|
return heroMapList;
|
|
}
|
|
|
|
public void setHeroMapList(Map<Integer, CommonProto.Hero> heroMapList) {
|
|
this.heroMapList = heroMapList;
|
|
}
|
|
} |