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 int[] roleId2; private int[] roleId3; private List heroList; private List heroList2; private List heroList3; private int roleLv; private int[] differDemonsId; private int differDemonsLv; private int poolId; private int totalForce; private int yxldTotalForce; private int breakId; private int starBreakId; private Map starOfHeroMap; private Map heroMapList; private Map heroMapList2; private Map heroMapList3; private static Map> sArenaRobotConfigByPoolMap; private static Map sArenaRobotConfigMap; private int msScroe; @Override public void init() throws Exception { Map> result = new HashMap<>(); Map 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 heroListTmp = new ArrayList<>(roleId.length); for(int heroId : roleId){ heroListTmp.add(heroId); } //玉虚论道第二个队伍 int[] roleId2 = sArenaRobotConfig.getRoleId2(); List heroListTmp2 = new ArrayList<>(roleId.length); for(int heroId : roleId2){ heroListTmp2.add(heroId); } //第三个队伍 int[] roleId3 = sArenaRobotConfig.getRoleId2(); List heroListTmp3 = new ArrayList<>(roleId.length); for(int heroId : roleId3){ heroListTmp3.add(heroId); } sArenaRobotConfig.setHeroList(heroListTmp); sArenaRobotConfig.setHeroList2(heroListTmp2); sArenaRobotConfig.setHeroList3(heroListTmp3); result.get(poolId).add(sArenaRobotConfig); } sArenaRobotConfigByPoolMap = result; sArenaRobotConfigMap = config; } public static List getSArenaRobotConfigsByPool( int poolId) { return sArenaRobotConfigByPoolMap.get(poolId); } public static Map 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[] getRoleId2() { return roleId2; } public int[] getRoleId3() { return roleId3; } public int getRoleLv() { return roleLv; } public int[] getDifferDemonsId() { return differDemonsId; } public int getDifferDemonsLv() { return differDemonsLv; } public int getPoolId() { return poolId; } public List getHeroList() { return heroList; } public void setHeroList(List heroList) { this.heroList = heroList; } public int getTotalForce() { return totalForce; } public void setTotalForce(int totalForce) { this.totalForce = totalForce; } public int getRobotLevel() { return robotLevel; } public Map getHeroMapList() { return heroMapList; } public void setHeroMapList(Map heroMapList) { this.heroMapList = heroMapList; } public Map getHeroMapList2() { return heroMapList2; } public void setHeroMapList2(Map heroMapList2) { this.heroMapList2 = heroMapList2; } public Map getHeroMapList3() { return heroMapList3; } public void setHeroMapList3(Map heroMapList3) { this.heroMapList3 = heroMapList3; } public List getHeroList2() { return heroList2; } public void setHeroList2(List heroList2) { this.heroList2 = heroList2; } public List getHeroList3() { return heroList3; } public void setHeroList3(List heroList3) { this.heroList3 = heroList3; } public int getMsScroe() { return msScroe; } public int getYxldTotalForce() { return yxldTotalForce; } public void setYxldTotalForce(int yxldTotalForce) { this.yxldTotalForce = yxldTotalForce; } }