예제 #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
파일: Over.cs 프로젝트: simonfox/DDDIntro
 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;
 }