72 lines
1.6 KiB
Java
72 lines
1.6 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 ="RunesPoolConfig")
|
||
|
public class SRunesPoolConfig implements BaseConfig {
|
||
|
|
||
|
private int id;
|
||
|
|
||
|
private int propertyId;
|
||
|
|
||
|
private int min;
|
||
|
|
||
|
private int max;
|
||
|
|
||
|
private int poolNum;
|
||
|
|
||
|
private int weight;
|
||
|
|
||
|
private static Map<Integer,List<SRunesPoolConfig>> sRunesPoolConfigsByPoolNum;
|
||
|
|
||
|
|
||
|
@Override
|
||
|
public void init() throws Exception {
|
||
|
Map<Integer,List<SRunesPoolConfig>> sRunesPoolConfigsByPoolNumTmp = new HashMap<>();
|
||
|
Map<Integer, SRunesPoolConfig> config = STableManager.getConfig(SRunesPoolConfig.class);
|
||
|
for(SRunesPoolConfig sRunesPoolConfig : config.values()){
|
||
|
int poolNum = sRunesPoolConfig.getPoolNum();
|
||
|
if(!sRunesPoolConfigsByPoolNumTmp.containsKey(poolNum)){
|
||
|
sRunesPoolConfigsByPoolNumTmp.put(poolNum,new ArrayList<>());
|
||
|
}
|
||
|
sRunesPoolConfigsByPoolNumTmp.get(poolNum).add(sRunesPoolConfig);
|
||
|
}
|
||
|
sRunesPoolConfigsByPoolNum = sRunesPoolConfigsByPoolNumTmp;
|
||
|
}
|
||
|
|
||
|
public static List<SRunesPoolConfig> getsRunesPoolConfigsByPoolNum(int poolNum) {
|
||
|
return sRunesPoolConfigsByPoolNum.get(poolNum);
|
||
|
}
|
||
|
|
||
|
public int getId() {
|
||
|
return id;
|
||
|
}
|
||
|
|
||
|
public int getPropertyId() {
|
||
|
return propertyId;
|
||
|
}
|
||
|
|
||
|
public int getMin() {
|
||
|
return min;
|
||
|
}
|
||
|
|
||
|
public int getMax() {
|
||
|
return max;
|
||
|
}
|
||
|
|
||
|
public int getPoolNum() {
|
||
|
return poolNum;
|
||
|
}
|
||
|
|
||
|
public int getWeight() {
|
||
|
return weight;
|
||
|
}
|
||
|
|
||
|
|
||
|
}
|