MatchAnalysis.py 599 B

123456789101112
  1. #!/usr/bin/env python2
  2. import Combinations, Matches
  3. def RepeatMatchCount(match):
  4. return sum([ Matches.GetMatchCount(a[0], a[1]) for a in Combinations.GetAllCombinations(match, 2) ])
  5. def SameRegionMatchCount(match):
  6. return len([ a for a in Combinations.GetAllCombinations(match, 2) if a[0].region == a[1].region])
  7. def RepeatRegionMatchCount(match, teamList):
  8. return sum([sum([Matches.GetMatchCount(b, a[1]) for b in teamList if b.region == a[0].region]) + sum([Matches.GetMatchCount(b, a[0]) for b in teamList if b.region == a[1]]) for a in Combinations.GetAllCombinations(match, 2)])