示例#1
0
        public double GetGameWinPercentage(bool withByes = true)
        {
            IEnumerable <Matchup> matchups;

            if (withByes)
            {
                matchups = this.Matchups;
            }
            else
            {
                matchups = Matchups.Where(n => !(n.Match.Matchups.Any(mn => mn.Player.Name == "BYE")));
            }

            double result = (double)matchups.Sum(n => n.Wins * 3 + n.Ties) / (double)(matchups.Sum(n => n.Wins + n.Ties + n.Losses) * 3);

            // Lower limit of game-win percentage set to 0.33 by MTG Tournament Rules
            return(Math.Max(result, 0.33));
        }
示例#2
0
        public double GetMatchWinPercentage(bool withByes = true)
        {
            IEnumerable <Matchup> matchups;

            if (withByes)
            {
                matchups = this.Matchups;
            }
            else
            {
                matchups = Matchups.Where(n => !(n.Match.Matchups.Any(mn => mn.Player.Name == "BYE")));
            }

            var result = (double)(matchups.Count(n => n.DidWin == true) * 3 + matchups.Count(n => n.DidTie)) / (double)(matchups.Count() * 3);

            // Lower limit of match-win percentage set to 0.33 by MTG Tournament Rules
            return(Math.Max(result, 0.33));
        }
示例#3
0
 public int GetMatchLosses()
 {
     return(Matchups.Where(n => n.DidWin == false && n.DidTie == false).Count());
 }
示例#4
0
 public int GetMatchTies()
 {
     return(Matchups.Where(n => n.DidTie == true).Count());
 }
示例#5
0
 public int GetMatchWins()
 {
     return(Matchups.Where(n => n.DidWin == true).Count());
 }