BattlePassTaskDataManager.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. using System.Collections.Generic;
  2. namespace GFGGame
  3. {
  4. public class BattlePassTaskDataManager : Singleton<BattlePassTaskDataManager>
  5. {
  6. //通行证赛季Id
  7. private int SeasonId = 0;
  8. //是否购买通行证
  9. private bool IsBuy = false;
  10. //已经领奖levelId
  11. private HashSet<int> NormalRewards = new HashSet<int>();
  12. //已经高级领奖levelId
  13. private HashSet<int> SuperRewards = new HashSet<int>();
  14. public int GetSeasonId()
  15. {
  16. return SeasonId;
  17. }
  18. public void AddNormalReward(int levelId)
  19. {
  20. NormalRewards.Add(levelId);
  21. }
  22. public void AddSuperReward(int levelId)
  23. {
  24. SuperRewards.Add(levelId);
  25. }
  26. public void SetSeasonId(int seasonId)
  27. {
  28. SeasonId = seasonId;
  29. }
  30. public void SetIsBuy(bool isBuy)
  31. {
  32. IsBuy = isBuy;
  33. }
  34. //检查普通领取状态
  35. public bool CheckLevelRewardGet(int levelId)
  36. {
  37. return NormalRewards.Contains(levelId);
  38. }
  39. //检查高级领取状态
  40. public bool CheckSuperLevelRewardGet(int levelId)
  41. {
  42. return SuperRewards.Contains(levelId);
  43. }
  44. }
  45. }