Пример #1
0
 internal BatterInnings(TeamInnings teamInnings, Player batter)
 {
     if (teamInnings == null) throw new ArgumentNullException("teamInnings");
     if (batter == null) throw new ArgumentNullException("batter");
     this.teamInnings = teamInnings;
     this.batter = batter;
     notOut = true;
     startTime = DateTime.Now;
 }
Пример #2
0
 internal Over(TeamInnings battingTeamInnings, Player bowler)
 {
     BattingTeamInnings = battingTeamInnings;
     Bowler = bowler;
 }
Пример #3
0
        public virtual TeamInnings NewInnings(Team battingTeam)
        {
            if (battingTeam == null) throw new ArgumentNullException("battingTeam");
            if (! (battingTeam.Equals(Team1) || battingTeam.Equals(Team2)))
                throw new InvalidOperationException("Team must be one of the teams in the match!");

            TeamInnings teamInnings;

            if (battingTeam.Equals(Team1))
            {
                teamInnings = new TeamInnings(Team1, Team2);
            }
            else
            {
                teamInnings = new TeamInnings(Team2, Team1);
            }

            innings.Add(teamInnings);

            return teamInnings;
        }
Пример #4
0
 internal Over(TeamInnings battingTeamInnings, Player bowler)
 {
     this.battingTeamInnings = battingTeamInnings;
     this.bowler = bowler;
 }