CollegeBoostCfgArray.cs 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. using System.Collections.Generic;
  2. using System.Linq;
  3. using cfg.GfgCfg;
  4. using ET;
  5. namespace GFGGame
  6. {
  7. public class CollegeBoostCfgArray : SingletonBaseET<CollegeBoostCfgArray>
  8. {
  9. //如成长任务下的所有子分类
  10. public List<CollegeBoostCfg> GetCollegeBoostsByTypePart(int typePart)
  11. {
  12. var collegeBoostCfgList =
  13. CommonDataManager.Tables.TblCollegeBoostCfg.DataList
  14. .Where(a => a.TypeParts == typePart)
  15. .ToList();
  16. return collegeBoostCfgList;
  17. }
  18. public int GetMaxStage(int typePart)
  19. {
  20. var collegeBoostCfgList =
  21. CommonDataManager.Tables.TblCollegeBoostCfg.DataList.Where(a => a.TypeParts == typePart).ToList();
  22. var maxData = collegeBoostCfgList
  23. .Where(a => a.TypePhase == collegeBoostCfgList.Max(x => x.TypePhase))
  24. .FirstOrDefault(a => a.Layer == collegeBoostCfgList.Max(x => x.Layer));
  25. return maxData.TypePhase;
  26. }
  27. public int GetMaxLvl(int typePart)
  28. {
  29. var collegeBoostCfgList =
  30. CollegeBoostCfgArray.Instance.GetCollegeBoostsByTypePart(typePart);
  31. var maxData = collegeBoostCfgList
  32. .Where(a => a.TypePhase == collegeBoostCfgList.Max(x => x.TypePhase))
  33. .FirstOrDefault(a => a.Layer == collegeBoostCfgList.Max(x => x.Layer));
  34. return maxData.Layer;
  35. }
  36. public CollegeBoostCfg GetCollegeBoostCfgListByTypePartsAndTypePhaseAndLayer(int typePart, int typePhase,
  37. int layer)
  38. {
  39. var data = CommonDataManager.Tables.TblCollegeBoostCfg.DataList.FirstOrDefault(a =>
  40. a.TypePhase == typePhase && a.Layer == layer);
  41. return data;
  42. }
  43. }
  44. }