PoemGalleryDataManager.cs 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. using System;
  2. using System.Collections.Generic;
  3. using System.IO;
  4. using ET;
  5. using FairyGUI;
  6. using UnityEngine;
  7. namespace GFGGame
  8. {
  9. public class PoemGalleryDataManager : SingletonBase<PoemGalleryDataManager>
  10. {
  11. /// <summary>
  12. /// 推荐Id数据
  13. /// </summary>
  14. public List<long> RecommendInfos = new List<long>();
  15. /// <summary>
  16. /// 好友Id数据
  17. /// </summary>
  18. public List<long> FrinedInfos = new List<long>();
  19. /// <summary>
  20. /// 收藏Id数据
  21. /// </summary>
  22. public List<long> FavoriteInfos = new List<long>();
  23. /// <summary>
  24. /// 我的作品Id数据
  25. /// </summary>
  26. public List<long> MySelfInfos = new List<long>();
  27. private Dictionary<long, PoemGalleryData> _dicGalleryInfo = new Dictionary<long, PoemGalleryData>();
  28. public void Clear()
  29. {
  30. _dicGalleryInfo.Clear();
  31. RecommendInfos.Clear();
  32. FrinedInfos.Clear();
  33. FavoriteInfos.Clear();
  34. MySelfInfos.Clear();
  35. }
  36. public void AddGalleryData(PoemGalleryData data)
  37. {
  38. _dicGalleryInfo.Add(data.PictureId, data);
  39. }
  40. public void RemoveGalleryData(PoemGalleryData data)
  41. {
  42. if (_dicGalleryInfo.ContainsKey(data.PictureId))
  43. {
  44. _dicGalleryInfo.Remove(data.PictureId);
  45. }
  46. }
  47. public void UpdateGalleryData(PoemGalleryData data)
  48. {
  49. if (_dicGalleryInfo.ContainsKey(data.PictureId))
  50. {
  51. _dicGalleryInfo.Remove(data.PictureId);
  52. }
  53. }
  54. public PoemGalleryData GetGalleryDataById(long pictureId)
  55. {
  56. if (_dicGalleryInfo.ContainsKey(pictureId))
  57. {
  58. return _dicGalleryInfo[pictureId];
  59. }
  60. return null;
  61. }
  62. }
  63. }