66 lines
1.6 KiB
Java
66 lines
1.6 KiB
Java
|
|
package config;
|
||
|
|
|
||
|
|
import manager.STableManager;
|
||
|
|
import manager.Table;
|
||
|
|
|
||
|
|
import java.util.HashMap;
|
||
|
|
import java.util.Map;
|
||
|
|
|
||
|
|
@Table(name ="WishActivityUp")
|
||
|
|
public class SWishActivityUp implements BaseConfig {
|
||
|
|
|
||
|
|
private int id;
|
||
|
|
|
||
|
|
private int activityId;
|
||
|
|
|
||
|
|
private int[][] upList;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 每期活动
|
||
|
|
* key: 活动id value: SWishActivityUp对象
|
||
|
|
*/
|
||
|
|
public static Map<Integer,SWishActivityUp> map = new HashMap<>();
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 每期得up
|
||
|
|
* key: 活动id value->map: key: upList[0][0](道具id) value: upList[0](道具详情)
|
||
|
|
*/
|
||
|
|
public static Map<Integer,Map<Integer,int[]>> upMap = new HashMap<>();
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 默认up
|
||
|
|
* key: 活动id value: 默认up奖励id
|
||
|
|
*/
|
||
|
|
public static Map<Integer, Integer> defaultMap = new HashMap<>();
|
||
|
|
|
||
|
|
@Override
|
||
|
|
public void init() throws Exception {
|
||
|
|
Map<Integer, SWishActivityUp> config = STableManager.getConfig(SWishActivityUp.class);
|
||
|
|
config.values().forEach(v->{
|
||
|
|
// 每期活动
|
||
|
|
map.put(v.getActivityId(),v);
|
||
|
|
// 每期全部up
|
||
|
|
HashMap<Integer, int[]> map1 = new HashMap<>(v.getUpList().length);
|
||
|
|
for (int[] ints : v.getUpList()) {
|
||
|
|
map1.put(ints[0],ints);
|
||
|
|
}
|
||
|
|
upMap.put(v.getActivityId(),map1);
|
||
|
|
// 每期up默认奖励id
|
||
|
|
defaultMap.put(v.getActivityId(),v.getUpList()[0][0]);
|
||
|
|
});
|
||
|
|
}
|
||
|
|
|
||
|
|
public int getId() {
|
||
|
|
return id;
|
||
|
|
}
|
||
|
|
|
||
|
|
public int getActivityId() {
|
||
|
|
return activityId;
|
||
|
|
}
|
||
|
|
|
||
|
|
public int[][] getUpList() {
|
||
|
|
return upList;
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
}
|