Esempio n. 1
0
        public static List<BattingRecord> Run(CricketMatch match)
        {
            var battingRecords = from i in match.Innings
                                 from b in i.Batting
                                 select CreateBattingRecord(b, i.TeamInningsNumber == 1);

            return battingRecords.ToList();
        }
Esempio n. 2
0
        public static List<BowlingRecord> Run(CricketMatch match)
        {
            var bowlingRecords = from i in match.Innings
                                 where i.Bowling != null
                                 from b in i.Bowling
                                 select CreateBowlingRecord(b);

            return bowlingRecords.ToList();
        }
Esempio n. 3
0
 public ScorecardParser(ScorecardDetails details, DependencyFinder finder)
 {
     _finder = finder;
     _match = new CricketMatch
                  {
                      Id = CricketMatch.GenerateId(details.Season, details.MatchCode),
                      MatchCode = details.MatchCode,
                      HomeTeam = details.HomeTeam,
                      AwayTeam = details.AwayTeam,
                      Season = details.Season,
                      StartDate = details.Date,
                      Players = "11 per side",
                      Innings = new List<Innings>()
                  };
 }
Esempio n. 4
0
        public static List<FieldingRecord> Run(CricketMatch match)
        {
            var fieldingRecord = from i in match.Innings
                                 from b in i.Batting
                                 where
                                     ((b.HowOut == HowOutType.Caught || b.HowOut == HowOutType.Stumped) &&
                                      !string.IsNullOrEmpty(b.FielderId))
                                 select new FieldingRecord
                                            {
                                                PlayerId = b.FielderId,
                                                Team = i.Bowling[0].Team,
                                                Catches = b.HowOut == HowOutType.Caught ? 1 : 0,
                                                Stumpings = b.HowOut == HowOutType.Stumped ? 1 : 0
                                            };

            return fieldingRecord.ToList();
        }
Esempio n. 5
0
 public MatchInfoParser(CricketMatch match, DependencyFinder finder)
 {
     _match = match;
     _finder = finder;
 }
Esempio n. 6
0
 public InningsParser(CricketMatch match)
 {
     _match = match;
 }