特权表修改
parent
5380c3cc23
commit
c6788d47e8
|
@ -3,7 +3,10 @@ package config;
|
|||
import manager.STableManager;
|
||||
import manager.Table;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.TreeMap;
|
||||
|
||||
@Table(name ="PrivilegeTypeConfig")
|
||||
public class SPrivilegeTypeConfig implements BaseConfig {
|
||||
|
@ -18,12 +21,31 @@ public class SPrivilegeTypeConfig implements BaseConfig {
|
|||
|
||||
private int ifFloat;
|
||||
|
||||
private int unlockType;
|
||||
|
||||
private int[][] condition;
|
||||
|
||||
private int continueTime;
|
||||
|
||||
private static Map<Integer,SPrivilegeTypeConfig> sPrivilegeTypeConfigMap;
|
||||
|
||||
public static Map<Integer,Map<Integer,Map<Integer,Integer>>> conditionMap;
|
||||
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
sPrivilegeTypeConfigMap = STableManager.getConfig(SPrivilegeTypeConfig.class);
|
||||
conditionMap = new HashMap<>();
|
||||
for (Map.Entry<Integer,SPrivilegeTypeConfig> entry:sPrivilegeTypeConfigMap.entrySet()){
|
||||
conditionMap.computeIfAbsent(entry.getValue().getUnlockType(),n->new HashMap<>()).computeIfAbsent(entry.getKey(),n->new TreeMap<>());
|
||||
if(entry.getValue().getCondition()!=null){
|
||||
for(int[] cond:entry.getValue().getCondition()){
|
||||
if(entry.getValue().getUnlockType()==2) {
|
||||
cond[0] = 10_000_000 * (cond[0] % 10) + cond[0];
|
||||
}
|
||||
conditionMap.get(entry.getValue().getUnlockType()).get(entry.getKey()).put(cond[0],cond[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -50,4 +72,16 @@ public class SPrivilegeTypeConfig implements BaseConfig {
|
|||
public int getIfFloat() {
|
||||
return ifFloat;
|
||||
}
|
||||
|
||||
public int getUnlockType() {
|
||||
return unlockType;
|
||||
}
|
||||
|
||||
public int[][] getCondition() {
|
||||
return condition;
|
||||
}
|
||||
|
||||
public int getContinueTime() {
|
||||
return continueTime;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue