60 lines
1.5 KiB
Java
60 lines
1.5 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 ="DifferDemonsBoxPools")
|
|
public class SDifferDemonsBoxPools implements BaseConfig {
|
|
|
|
private int id;
|
|
|
|
private int[] reward;
|
|
|
|
private int pool;
|
|
|
|
private int weight;
|
|
|
|
private static Map<Integer, List<SDifferDemonsBoxPools>> sDifferDemonsBoxPoolByPoolMap;
|
|
|
|
|
|
@Override
|
|
public void init() throws Exception {
|
|
Map<Integer, List<SDifferDemonsBoxPools>> sDifferDemonsBoxPoolByPoolMapTmp = new HashMap<>();
|
|
Map<Integer, SDifferDemonsBoxPools> config = STableManager.getConfig(SDifferDemonsBoxPools.class);
|
|
for(SDifferDemonsBoxPools sDifferDemonsBoxPool : config.values()){
|
|
int pool = sDifferDemonsBoxPool.getPool();
|
|
if(!sDifferDemonsBoxPoolByPoolMapTmp.containsKey(pool)){
|
|
sDifferDemonsBoxPoolByPoolMapTmp.put(pool,new ArrayList<>());
|
|
}
|
|
sDifferDemonsBoxPoolByPoolMapTmp.get(pool).add(sDifferDemonsBoxPool);
|
|
}
|
|
sDifferDemonsBoxPoolByPoolMap = sDifferDemonsBoxPoolByPoolMapTmp;
|
|
}
|
|
|
|
public static List<SDifferDemonsBoxPools> getsDifferDemonsBoxPoolByPoolId(int poolId) {
|
|
return sDifferDemonsBoxPoolByPoolMap.get(poolId);
|
|
}
|
|
|
|
public int getId() {
|
|
return id;
|
|
}
|
|
|
|
public int[] getReward() {
|
|
return reward;
|
|
}
|
|
|
|
public int getPool() {
|
|
return pool;
|
|
}
|
|
|
|
public int getWeight() {
|
|
return weight;
|
|
}
|
|
|
|
|
|
} |