SuitCfg.cs 851 B

123456789101112131415161718192021222324252627282930
  1. using System.Collections.Generic;
  2. using System.Linq;
  3. using ET;
  4. namespace cfg.GfgCfg
  5. {
  6. public partial class SuitCfg
  7. {
  8. private Dictionary<int, List<int>> _suitCfgPartsDic = new Dictionary<int, List<int>>();
  9. public List<int> Parts
  10. {
  11. get
  12. {
  13. _suitCfgPartsDic.TryGetValue(Id, out var outList);
  14. if (outList == null || outList.Count == 0)
  15. {
  16. var list = CommonDataManager.Tables.TblItemCfg.DataList
  17. .Where(a => a.ItemType == ConstItemType.DRESS_UP && a.SuitId == Id).ToList();
  18. outList = list != null ? list.Select(a => a.Id).ToList() : new List<int>();
  19. _suitCfgPartsDic[Id] = outList;
  20. }
  21. return outList;
  22. }
  23. }
  24. }
  25. }