| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- using System.Collections.Generic;
- using System.Linq;
- using cfg.GfgCfg;
- using ET;
- namespace GFGGame
- {
- public class CollegeBoostCfgArray : SingletonBaseET<CollegeBoostCfgArray>
- {
- //如成长任务下的所有子分类
- public List<CollegeBoostCfg> GetCollegeBoostsByTypePart(int typePart)
- {
- var collegeBoostCfgList =
- CommonDataManager.Tables.TblCollegeBoostCfg.DataList
- .Where(a => a.TypeParts == typePart)
- .ToList();
- return collegeBoostCfgList;
- }
- public int GetMaxStage(int typePart)
- {
- var collegeBoostCfgList =
- CommonDataManager.Tables.TblCollegeBoostCfg.DataList.Where(a => a.TypeParts == typePart).ToList();
- var maxData = collegeBoostCfgList
- .Where(a => a.TypePhase == collegeBoostCfgList.Max(x => x.TypePhase))
- .FirstOrDefault(a => a.Layer == collegeBoostCfgList.Max(x => x.Layer));
- return maxData.TypePhase;
- }
- public int GetMaxLvl(int typePart)
- {
- var collegeBoostCfgList =
- CollegeBoostCfgArray.Instance.GetCollegeBoostsByTypePart(typePart);
- var maxData = collegeBoostCfgList
- .Where(a => a.TypePhase == collegeBoostCfgList.Max(x => x.TypePhase))
- .FirstOrDefault(a => a.Layer == collegeBoostCfgList.Max(x => x.Layer));
- return maxData.Layer;
- }
- public CollegeBoostCfg GetCollegeBoostCfgListByTypePartsAndTypePhaseAndLayer(int typePart, int typePhase,
- int layer)
- {
- var data = CommonDataManager.Tables.TblCollegeBoostCfg.DataList.FirstOrDefault(a =>
- a.TypePhase == typePhase && a.Layer == layer);
- return data;
- }
- }
- }
|