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

51 lines
1.0 KiB
Java
Raw Normal View History

2019-12-24 14:23:23 +08:00
package config;
import manager.STableManager;
import manager.Table;
import java.util.HashMap;
import java.util.Map;
@Table(name ="LuxuryFund")
public class SLuxuryFund implements BaseConfig {
private int id;
private int type;
private int day;
private int[][] reward;
2021-07-14 17:11:57 +08:00
/**
* key: type value: < key: day value: SLuxuryFund >
*/
public static Map<Integer,Map<Integer,SLuxuryFund>> typeMap = new HashMap<>();
2019-12-24 14:23:23 +08:00
@Override
public void init() throws Exception {
Map<Integer, SLuxuryFund> config = STableManager.getConfig(SLuxuryFund.class);
2021-07-14 17:11:57 +08:00
config.values().forEach(v->{
Map<Integer, SLuxuryFund> fundMap = typeMap.getOrDefault(v.getType(), new HashMap<>());
2022-01-24 17:10:11 +08:00
fundMap.put(v.getId(),v);
2021-07-14 17:11:57 +08:00
typeMap.put(v.getType(),fundMap);
2019-12-24 14:23:23 +08:00
});
}
public int getId() {
return id;
}
public int getType() {
return type;
}
public int getDay() {
return day;
}
2021-07-14 17:11:57 +08:00
public int[][] getReward() {
2019-12-24 14:23:23 +08:00
return reward;
}
}