84 lines
2.1 KiB
Java
84 lines
2.1 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;
|
|
|
|
private int[][] rewardList;
|
|
|
|
/**
|
|
* 每期活动
|
|
* 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<>();
|
|
|
|
/**
|
|
* 每期得reward
|
|
* key: 活动id value->map: key: upList[0][0](道具id) value: rewardList[0](奖励详情)
|
|
*/
|
|
public static Map<Integer,Map<Integer,int[]>> rewardMap = 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默认奖励id
|
|
defaultMap.put(v.getActivityId(),v.getUpList()[0][0]);
|
|
|
|
// 每期全部up
|
|
HashMap<Integer, int[]> map1 = new HashMap<>(v.getUpList().length);
|
|
// 每期得奖励
|
|
HashMap<Integer, int[]> map2 = new HashMap<>(v.getRewardList().length);
|
|
|
|
for (int i = 0; i < v.getUpList().length; i++) {
|
|
map1.put(v.getUpList()[i][0],v.getUpList()[i]);
|
|
map2.put(v.getUpList()[i][0],v.getRewardList()[i]);
|
|
}
|
|
|
|
upMap.put(v.getActivityId(),map1);
|
|
rewardMap.put(v.getActivityId(),map2);
|
|
});
|
|
}
|
|
|
|
public int getId() {
|
|
return id;
|
|
}
|
|
|
|
public int getActivityId() {
|
|
return activityId;
|
|
}
|
|
|
|
public int[][] getUpList() {
|
|
return upList;
|
|
}
|
|
|
|
public int[][] getRewardList() {
|
|
return rewardList;
|
|
}
|
|
} |