public static Set parseSetScore(this string setString) { setString = setString.Replace(" ", ""); string[] scores = setString.Split("()".ToCharArray()); Set set = new Set(); set.Games = parseScore(scores[0]); if (scores.Length > 1) set.Tiebreak = parseScore(scores[1]); return set; }
private static void AddSet(this Match match, byte winnerGames, byte loserGames, byte? winnerTiebreak, byte? loserTiebreak) { var set = new Set(); set.Games.W = winnerGames; set.Games.L = loserGames; if (!set.Games.Played) return; set.Tiebreak.W = winnerTiebreak.HasValue ? winnerTiebreak.Value : (byte)0; set.Tiebreak.L = loserTiebreak.HasValue ? loserTiebreak.Value : (byte)0; match.Score.Sets.Add(set); }