MatchAnalysis.cs 792 B

1234567891011121314151617181920212223
  1. using System.Collections.Generic;
  2. using System.Linq;
  3. namespace MISTBowl_Brackets
  4. {
  5. public static class MatchAnalysis
  6. {
  7. public static int RepeatMatchCount(this List<Team> match)
  8. {
  9. return Combinations.GetAllCombinations(match, 2).Sum(a => Matches.GetMatchCount(a[0], a[1]));
  10. }
  11. public static int SameRegionMatchCount(this List<Team> match)
  12. {
  13. return Combinations.GetAllCombinations(match, 2).Count(a => a[0].region == a[1].region);
  14. }
  15. public static int RepeatRegionMatchCount(this List<Team> match, List<Team> teamList)
  16. {
  17. return Combinations.GetAllCombinations(match, 2).Sum(a => teamList.Where(b => b.region == a[1].region).Sum(b => Matches.GetMatchCount(a[0], b)) + teamList.Where(b => b.region == a[0].region).Sum(b => Matches.GetMatchCount(a[1], b)));
  18. }
  19. }
  20. }