RechargeDataManager.cs 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. using System.Collections.Generic;
  2. namespace GFGGame
  3. {
  4. public class RechargeDataManager : SingletonBase<RechargeDataManager>
  5. {
  6. private Dictionary<int, int> _rechargeDic = new Dictionary<int, int>();
  7. private Dictionary<int, int> _giftDic = new Dictionary<int, int>();
  8. private Dictionary<int, int> _exchangeDic = new Dictionary<int, int>();
  9. public void Clear()
  10. {
  11. _rechargeDic.Clear();
  12. _giftDic.Clear();
  13. _exchangeDic.Clear();
  14. }
  15. public void UpdateRechargeData(int rechargeId, int num)
  16. {
  17. if (!_rechargeDic.ContainsKey(rechargeId))
  18. {
  19. _rechargeDic.Add(rechargeId, num);
  20. }
  21. else
  22. {
  23. _rechargeDic[rechargeId] = num;
  24. }
  25. }
  26. public void UpdateGiftData(int giftId, int num)
  27. {
  28. if (!_giftDic.ContainsKey(giftId))
  29. {
  30. _giftDic.Add(giftId, num);
  31. }
  32. else
  33. {
  34. _giftDic[giftId] = num;
  35. }
  36. }
  37. public void UpdateExchangeData(int exchangeId, int num)
  38. {
  39. if (!_exchangeDic.ContainsKey(exchangeId))
  40. {
  41. _exchangeDic.Add(exchangeId, num);
  42. }
  43. else
  44. {
  45. _exchangeDic[exchangeId] = num;
  46. }
  47. }
  48. public List<GiftBagCfg> GetGiftBagDatas()
  49. {
  50. GiftBagCfg[] giftBagCfgs = GiftBagCfgArray.Instance.dataArray;
  51. List<GiftBagCfg> giftBagDatas = new List<GiftBagCfg>();
  52. for (int i = 0; i < giftBagCfgs.Length; i++)
  53. {
  54. }
  55. return giftBagDatas;
  56. }
  57. }
  58. }