示例#1
0
        // wanted to make this internal
        public virtual void RecordOverCommenced(Over over)
        {
            if (over == null) throw new ArgumentNullException("over");
            if (! over.Bowler.Equals(Bowler)) throw new ArgumentException("Over has different bowler!");

            overs.Add(over);
        }
示例#2
0
        public virtual Over NewOver(Player bowler)
        {
            if (bowler == null) throw new ArgumentNullException("bowler");
            if (! FieldingTeam.Members.Contains(bowler))
                throw new InvalidOperationException("Player not a member of the fielding team! " + bowler);

            var over = new Over(this, bowler);
            overs.Add(over);

            GetBowlingSpell(bowler).RecordOverCommenced(over);

            return over;
        }