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)); }
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)); }
public int GetMatchLosses() { return(Matchups.Where(n => n.DidWin == false && n.DidTie == false).Count()); }
public int GetMatchTies() { return(Matchups.Where(n => n.DidTie == true).Count()); }
public int GetMatchWins() { return(Matchups.Where(n => n.DidWin == true).Count()); }