コード例 #1
0
        /// <summary>
        /// Aggregates the pitching statistics.
        /// </summary>
        /// <param name="gamePitchingStatistics">PitchingStatisticsContainer</param>
        /// <param name="gameInningsPitched">int</param>
        protected virtual void AggregatePitchingStatistics(PitchingStatisticsContainer gamePitchingStatistics, int gameInningsPitched)
        {
            this.seasonPitchingStatistics.AtBats           += gamePitchingStatistics.AtBats;
            this.seasonPitchingStatistics.BattersFaced     += gamePitchingStatistics.BattersFaced;
            this.seasonPitchingStatistics.Balks            += gamePitchingStatistics.Balks;
            this.seasonPitchingStatistics.HitByPitches     += gamePitchingStatistics.HitByPitches;
            this.seasonPitchingStatistics.Walks            += gamePitchingStatistics.Walks;
            this.seasonPitchingStatistics.Strikeouts       += gamePitchingStatistics.Strikeouts;
            this.seasonPitchingStatistics.GroundOuts       += gamePitchingStatistics.GroundOuts;
            this.seasonPitchingStatistics.FlyOuts          += gamePitchingStatistics.FlyOuts;
            this.seasonPitchingStatistics.SacrificeFlyouts += gamePitchingStatistics.SacrificeFlyouts;
            this.seasonPitchingStatistics.Singles          += gamePitchingStatistics.Singles;
            this.seasonPitchingStatistics.Doubles          += gamePitchingStatistics.Doubles;
            this.seasonPitchingStatistics.Triples          += gamePitchingStatistics.Triples;
            this.seasonPitchingStatistics.Homeruns         += gamePitchingStatistics.Homeruns;
            this.seasonPitchingStatistics.RunsAllowed      += gamePitchingStatistics.RunsAllowed;
            this.seasonPitchingStatistics.TotalOuts        += gamePitchingStatistics.TotalOuts;
            this.seasonPitchingStatistics.Wins             += gamePitchingStatistics.Wins;
            this.seasonPitchingStatistics.Losses           += gamePitchingStatistics.Losses;
            this.seasonPitchingStatistics.Saves            += gamePitchingStatistics.Saves;

            bool completeGamePitched = (int)gamePitchingStatistics.InningsPitched == gameInningsPitched;
            bool shutoutPitched      = completeGamePitched && (gamePitchingStatistics.RunsAllowed == 0);
            bool perfectGame         = (gamePitchingStatistics.BattersFaced == ((int)gameInningsPitched * 3)) && (gamePitchingStatistics.TotalOuts == ((int)gameInningsPitched * 3));

            if (completeGamePitched)
            {
                this.seasonPitchingStatistics.CompleteGames++;
                if (gamePitchingStatistics.Hits == 0)//no hitter!
                {
                    this.seasonPitchingStatistics.NoHitters++;
                }
            }

            if (perfectGame)//perfect game!!!
            {
                this.seasonPitchingStatistics.PerfectGames++;
                this.seasonPitchingStatistics.NoHitters++;
            }

            if (shutoutPitched)
            {
                this.seasonPitchingStatistics.Shutouts++;
            }
        }
コード例 #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="T:StatusQuoBaseball.Base.SeasonStatisticsContainer"/> class.
 /// </summary>
 /// <param name="person">Person.</param>
 public SeasonStatisticsContainer(Person person) : base(person)
 {
     this.seasonBattingStatistics  = new BattingStatisticsContainer((Player)this.person);
     this.seasonPitchingStatistics = new PitchingStatisticsContainer((Player)this.person);
     this.seasonFieldingStatistics = new FieldingStatisticsContainer((Player)this.person);
 }
コード例 #3
0
 /// <summary>
 /// Aggregates the pitching statistics.
 /// </summary>
 /// <param name="gamePitchingStatistics">Game pitching statistics.</param>
 /// <param name="gameInningsPitched">Game innings pitched.</param>
 protected override void AggregatePitchingStatistics(PitchingStatisticsContainer gamePitchingStatistics, int gameInningsPitched)
 {
     base.AggregatePitchingStatistics(gamePitchingStatistics, gameInningsPitched);
 }
コード例 #4
0
 /// <summary>
 /// Initializes a new instance of the
 /// <see cref="T:StatusQuoBaseball.Base.SabermetricsPitchingStatisticsContainer"/> class.
 /// </summary>
 /// <param name="person">Person.</param>
 public SabermetricsPitchingStatisticsContainer(Person person) : base(person)
 {
     this.pStats = ((Player)person).PitchingStats.PitchingStatistics;
 }