using System.Collections.Generic; using ET; namespace GFGGame { public class BattlePassTaskDataManager : Singleton { //通行证赛季Id private int SeasonId = 0; //是否购买通行证 private bool IsBuy = false; private long SeasonEndTime = 0; //已经领奖levelId private HashSet NormalRewards = new HashSet(); //已经高级领奖levelId private HashSet SuperRewards = new HashSet(); public int GetSeasonId() { return SeasonId; } public void AddNormalReward(int levelId) { NormalRewards.Add(levelId); } public void AddSuperReward(int levelId) { SuperRewards.Add(levelId); } public void SetSeasonId(int seasonId) { SeasonId = seasonId; //设置赛季结束时间 //获取赛季配置 var seasonCfg = BattlePassOpenCfgArray.Instance.GetCfg(seasonId); if (seasonCfg == null) return; SeasonEndTime = TimeUtil.GetResetTimeSec(seasonCfg.endTime); } public void SetIsBuy(bool isBuy) { IsBuy = isBuy; } //检查普通领取状态 public bool CheckLevelRewardGet(int levelId) { return NormalRewards.Contains(levelId); } //检查高级领取状态 public bool CheckSuperLevelRewardGet(int levelId) { return SuperRewards.Contains(levelId); } //获取赛季结束时间 public long GetSeasonEndTime() { return SeasonEndTime; } //获取通行证当前等级 public int GetBattlePassLevel() { return GameGlobal.myNumericComponent.GetAsInt(NumericType.PassLevel); } } }