public bool GetFactionRemoveList(int factionId, int rank, out List <int> factionRemoveList) { factionRemoveList = new GroupList(); GetFactionAddList(factionId, rank, out var factionAddList); if (!factionTableEfficient.ContainsKey(factionId)) { return(false); } foreach (var factionTable in factionTableEfficient[factionId]) { foreach (var groupId in factionTable.Value) { if (factionAddList.Contains(groupId)) { continue; } if (!factionRemoveList.Contains(groupId)) { factionRemoveList.Add(groupId); } } } return(factionRemoveList.Any()); }
public bool GetGangRemoveList(int gangId, int rank, out List <int> gangRemoveList) { gangRemoveList = new GroupList(); GetGangAddList(gangId, rank, out var gangAddList); if (!gangTableEfficient.ContainsKey(gangId)) { return(false); } foreach (var gangTable in gangTableEfficient[gangId]) { foreach (var groupId in gangTable.Value) { if (gangAddList.Contains(groupId)) { continue; } if (!gangRemoveList.Contains(groupId)) { gangRemoveList.Add(groupId); } } } return(gangRemoveList.Any()); }
public bool GetCompanyRemoveList(int companyId, int rank, out List <int> companyRemoveList) { companyRemoveList = new GroupList(); GetCompanyAddList(companyId, rank, out var companyAddList); if (!companyTableEfficient.ContainsKey(companyId)) { return(false); } foreach (var companyTable in companyTableEfficient[companyId]) { foreach (var groupId in companyTable.Value) { if (companyAddList.Contains(groupId)) { continue; } if (!companyRemoveList.Contains(groupId)) { companyRemoveList.Add(groupId); } } } return(companyRemoveList.Any()); }
/// <summary> /// 设置全校有效的组、有课的班级和有课的教师(GroupList、SquadList、TeacherList) /// </summary> private void SetDataList() { GroupList.Clear(); SquadList.Clear(); TeacherList.Clear(); foreach (EnClsLesson clsLsn in DataRule.Lsn.eachClsLesson()) { if (clsLsn.SharedTime > 0) { if (!SquadList.Contains(clsLsn.Squad)) { SquadList.Add(clsLsn.Squad); } if (clsLsn.Teacher != null && !TeacherList.Contains(clsLsn.Teacher)) { TeacherList.Add(clsLsn.Teacher); } } } GroupList.Add(AllMember); GroupList.Add(AllSquad); GroupList.Add(AllTeacher); foreach (EnSquad sqd in SquadList) { foreach (EnSquadGroup grp in DataRule.Sqd.GetGroups(sqd)) { if (!GroupList.Contains(grp)) { GroupList.Add(grp); } } } foreach (EnTeacher tch in TeacherList) { foreach (EnTeacherGroup grp in DataRule.Tch.GetGroups(tch)) { if (!GroupList.Contains(grp)) { GroupList.Add(grp); } } } }