145 lines
3.2 KiB
Java
145 lines
3.2 KiB
Java
|
package config;
|
||
|
|
||
|
import manager.STableManager;
|
||
|
import manager.Table;
|
||
|
|
||
|
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 Map<Integer,Integer> starOfHeroMap;
|
||
|
|
||
|
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 Map<Integer, Integer> getStarOfHeroMap() {
|
||
|
return starOfHeroMap;
|
||
|
}
|
||
|
|
||
|
public int getBreakId() {
|
||
|
return breakId;
|
||
|
}
|
||
|
|
||
|
public void setBreakId(int breakId) {
|
||
|
this.breakId = breakId;
|
||
|
}
|
||
|
|
||
|
public void setStarOfHeroMap(Map<Integer, Integer> starOfHeroMap) {
|
||
|
this.starOfHeroMap = starOfHeroMap;
|
||
|
}
|
||
|
|
||
|
public int getRobotLevel() {
|
||
|
return robotLevel;
|
||
|
}
|
||
|
}
|