miduo_server/tablemanager/src/main/java/config/SWishConfig.java

68 lines
1.3 KiB
Java
Raw Normal View History

2023-05-29 10:53:39 +08:00
package config;
import manager.STableManager;
import manager.Table;
2023-06-14 11:18:29 +08:00
import java.util.HashMap;
2023-05-29 10:53:39 +08:00
import java.util.Map;
@Table(name ="WishConfig")
public class SWishConfig implements BaseConfig {
private int id;
2023-06-14 11:18:29 +08:00
private int level;
private int lotteryType;
2023-05-29 10:53:39 +08:00
private int drawCardNumber;
private int[][] reward;
private int weight;
2024-05-10 19:02:48 +08:00
private int mythWeight;
2023-05-29 10:53:39 +08:00
public static Map<Integer, SWishConfig> map;
2023-06-14 11:18:29 +08:00
public static Map<Integer, Map<Integer, SWishConfig>> typeMap = new HashMap<>();
2023-05-29 10:53:39 +08:00
@Override
public void init() throws Exception {
map = STableManager.getConfig(SWishConfig.class);
2023-06-14 11:18:29 +08:00
for (SWishConfig value : map.values()) {
Map<Integer, SWishConfig> configMap = typeMap.getOrDefault(value.getLotteryType(), new HashMap<>());
configMap.put(value.id,value);
typeMap.put(value.getLotteryType(), configMap);
}
2023-05-29 10:53:39 +08:00
}
public int getId() {
return id;
}
2023-06-14 11:18:29 +08:00
public int getLevel() {
return level;
}
public int getLotteryType() {
return lotteryType;
}
public int getDrawCardNumber() {
2023-05-29 10:53:39 +08:00
return drawCardNumber;
}
public int[][] getReward() {
return reward;
}
public int getWeight() {
return weight;
}
2024-05-10 19:02:48 +08:00
public int getMythWeight() {
return mythWeight;
}
2023-05-29 10:53:39 +08:00
}