Ejemplo 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();
        }
Ejemplo 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();
        }
Ejemplo 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>()
                  };
 }
Ejemplo 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();
        }
Ejemplo n.º 5
0
 public MatchInfoParser(CricketMatch match, DependencyFinder finder)
 {
     _match = match;
     _finder = finder;
 }
Ejemplo n.º 6
0
 public InningsParser(CricketMatch match)
 {
     _match = match;
 }