/// <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++; } }
/// <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); }
/// <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); }
/// <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; }