234 lines
6.0 KiB
Java
234 lines
6.0 KiB
Java
package config;
|
|
|
|
import manager.STableManager;
|
|
import manager.Table;
|
|
import util.TimeUtils;
|
|
import util.StringUtil;
|
|
|
|
import java.util.*;
|
|
|
|
@Table(name ="RechargeCommodityConfig")
|
|
public class SRechargeCommodityConfig implements BaseConfig {
|
|
private int id;
|
|
|
|
private String name;
|
|
|
|
private int type;
|
|
|
|
private int price;
|
|
|
|
private int[][] firstMultiple;
|
|
|
|
private int[][] baseReward;
|
|
|
|
private int[][][] extraReward;
|
|
|
|
private int limit;
|
|
|
|
private int firstInvest;
|
|
|
|
private int isDiscount;
|
|
|
|
private int[] discountType;
|
|
|
|
private int order;
|
|
|
|
private int accumulativeRecharge;
|
|
|
|
private int[][] playerLevel;
|
|
|
|
private int[] openPrivilege;
|
|
|
|
private int contiueDays;
|
|
|
|
|
|
|
|
private int time;
|
|
private String startTime;
|
|
private String endtime;
|
|
|
|
|
|
private long startTimeLong;
|
|
private long endTimeLong;
|
|
|
|
private int limitShow;
|
|
|
|
private int dailyUpdate;
|
|
|
|
private int[] passiveSkill;
|
|
|
|
|
|
|
|
public static Map<Integer, SRechargeCommodityConfig> rechargeCommodityConfigMap;
|
|
public static Map<Integer, SRechargeCommodityConfig> rechargeLevelMap;
|
|
private static Map<Integer,Integer> recharegeHeroTime;
|
|
public static TreeMap<Integer,Integer> rechargePlayerLevelMap;
|
|
public static Set<SRechargeCommodityConfig> refreshItemInfo;
|
|
|
|
@Override
|
|
public void init() throws Exception {
|
|
Map<Integer, SRechargeCommodityConfig> config = STableManager.getConfig(SRechargeCommodityConfig.class);
|
|
Map<Integer, SRechargeCommodityConfig> rechargeLevelMapTmp = new HashMap<>();
|
|
|
|
Map<Integer, Integer> recharegeHeroTimeTmp = new HashMap<>();
|
|
TreeMap<Integer,Integer> rechargePlayerLevelTemp = new TreeMap<>();
|
|
Set<SRechargeCommodityConfig> refreshItemInfoTmp = new HashSet<>();
|
|
for(SRechargeCommodityConfig sRechargeCommodityConfig : config.values()){
|
|
int[] discountType = sRechargeCommodityConfig.getDiscountType();
|
|
if(discountType!=null && discountType.length>0 &&discountType[0] == 2){
|
|
int level = discountType[1];
|
|
rechargeLevelMapTmp.put(level,sRechargeCommodityConfig);
|
|
}
|
|
if(discountType!=null && discountType.length>0 &&sRechargeCommodityConfig.getTime()==4) {
|
|
if (discountType[0] == 4&&sRechargeCommodityConfig.getDiscountType().length==3) {
|
|
recharegeHeroTimeTmp.put(discountType[1], sRechargeCommodityConfig.getId());
|
|
} else if (discountType[0] == 3) {
|
|
rechargePlayerLevelTemp.put(discountType[1], sRechargeCommodityConfig.getId());
|
|
}
|
|
}
|
|
if(sRechargeCommodityConfig.getDailyUpdate()>0){
|
|
refreshItemInfoTmp.add(sRechargeCommodityConfig);
|
|
}
|
|
|
|
int time = sRechargeCommodityConfig.getTime();
|
|
String startTime = sRechargeCommodityConfig.getStartTime();
|
|
String endtime = sRechargeCommodityConfig.getEndtime();
|
|
if(time ==1 ){ // ActivityType.OPEN_TYPE_TIME
|
|
if(!"0".equals(startTime)){
|
|
sRechargeCommodityConfig.setStartTimeLong(TimeUtils.parseTimeToMiles(startTime,TimeUtils.Stand_CeHua_Data_format));
|
|
}
|
|
if(!"0".equals(endtime)){
|
|
sRechargeCommodityConfig.setEndTimeLong(TimeUtils.parseTimeToMiles(endtime,TimeUtils.Stand_CeHua_Data_format));
|
|
}
|
|
|
|
continue;
|
|
}
|
|
if(!StringUtil.isEmpty(startTime)){
|
|
sRechargeCommodityConfig.setStartTimeLong(Long.parseLong(startTime));
|
|
}
|
|
if(!StringUtil.isEmpty(endtime)){
|
|
sRechargeCommodityConfig.setEndTimeLong(Long.parseLong(endtime));
|
|
}
|
|
}
|
|
rechargeCommodityConfigMap = config;
|
|
rechargeLevelMap = rechargeLevelMapTmp;
|
|
recharegeHeroTime = recharegeHeroTimeTmp;
|
|
refreshItemInfo = refreshItemInfoTmp;
|
|
rechargePlayerLevelMap = rechargePlayerLevelTemp;
|
|
|
|
}
|
|
|
|
|
|
|
|
public int getId() {
|
|
return id;
|
|
}
|
|
|
|
public int getType() {
|
|
return type;
|
|
}
|
|
|
|
public int getPrice() {
|
|
return price;
|
|
}
|
|
|
|
public int[][] getFirstMultiple() {
|
|
return firstMultiple;
|
|
}
|
|
|
|
public int[][] getBaseReward() {
|
|
return baseReward;
|
|
}
|
|
|
|
public int[][][] getExtraReward() {
|
|
return extraReward;
|
|
}
|
|
|
|
public int getLimit() {
|
|
return limit;
|
|
}
|
|
|
|
public int getFirstInvest() {
|
|
return firstInvest;
|
|
}
|
|
|
|
public int getIsDiscount() {
|
|
return isDiscount;
|
|
}
|
|
|
|
public int[] getDiscountType() {
|
|
return discountType;
|
|
}
|
|
|
|
public int getOrder() {
|
|
return order;
|
|
}
|
|
|
|
public int getAccumulativeRecharge() {
|
|
return accumulativeRecharge;
|
|
}
|
|
|
|
public int[][] getPlayerLevel() {
|
|
return playerLevel;
|
|
}
|
|
|
|
public int[] getOpenPrivilege() {
|
|
return openPrivilege;
|
|
}
|
|
|
|
public int getTime() {
|
|
return time;
|
|
}
|
|
|
|
public String getStartTime() {
|
|
return startTime;
|
|
}
|
|
|
|
public String getEndtime() {
|
|
return endtime;
|
|
}
|
|
|
|
public int getContiueDays() {
|
|
return contiueDays;
|
|
}
|
|
|
|
public String getName() {
|
|
return name;
|
|
}
|
|
|
|
public void setStartTimeLong(long startTimeLong) {
|
|
this.startTimeLong = startTimeLong;
|
|
}
|
|
|
|
public void setEndTimeLong(long endTimeLong) {
|
|
this.endTimeLong = endTimeLong;
|
|
}
|
|
|
|
public long getStartTimeLong() {
|
|
return startTimeLong;
|
|
}
|
|
|
|
public long getEndTimeLong() {
|
|
return endTimeLong;
|
|
}
|
|
public int getLimitShow() {
|
|
return limitShow;
|
|
}
|
|
|
|
public int getDailyUpdate() {
|
|
return dailyUpdate;
|
|
}
|
|
|
|
public int[] getPassiveSkill() {
|
|
return passiveSkill;
|
|
}
|
|
|
|
public static Map<Integer, Integer> getRecharegeHeroTime() {
|
|
return recharegeHeroTime;
|
|
}
|
|
|
|
public static void setRecharegeHeroTime(Map<Integer, Integer> recharegeHeroTime) {
|
|
SRechargeCommodityConfig.recharegeHeroTime = recharegeHeroTime;
|
|
}
|
|
|
|
} |