68 lines
1.4 KiB
Java
68 lines
1.4 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, SRunesPoolConfig> config = STableManager.getConfig(SRunesPoolConfig.class);
|
|
sRunesPoolConfigsByPoolNum = new HashMap<>();
|
|
for(SRunesPoolConfig sRunesPoolConfig : config.values()){
|
|
int poolNum = sRunesPoolConfig.getPoolNum();
|
|
sRunesPoolConfigsByPoolNum.computeIfAbsent(poolNum,v->new ArrayList<>()).add(sRunesPoolConfig);
|
|
}
|
|
}
|
|
|
|
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;
|
|
}
|
|
|
|
|
|
} |