99
1010namespace SMB3Explorer . Models . Exports ;
1111
12- public class BattingSeasonStatistic
12+ public class BattingSeasonStatistic : BattingStatistic
1313{
14- [ Name ( "player_id" ) , Index ( 0 ) ]
15- public Guid ? PlayerId { get ; set ; }
14+ [ Ignore ]
15+ public int AggregatorId { get ; set ; }
1616
17- [ Name ( "first_name" ) , Index ( 1 ) ]
18- public string FirstName { get ; set ; } = string . Empty ;
19-
20- [ Name ( "last_name" ) , Index ( 2 ) ]
21- public string LastName { get ; set ; } = string . Empty ;
22-
23- [ Name ( "current_team_name" ) , Index ( 3 ) ]
24- public string ? CurrentTeam { get ; set ; }
25-
26- [ Name ( "previous_team_name" ) , Index ( 4 ) ]
27- public string ? PreviousTeam { get ; set ; }
28-
29- [ Name ( "primary_position" ) , Index ( 5 ) ]
30- public int PositionNumber { get ; set ; }
31-
32- [ Name ( "primary_position_name" ) , Index ( 6 ) ]
33- // ReSharper disable once UnusedMember.Global
34- public string Position => ( ( BaseballPlayerPosition ) PositionNumber ) . GetEnumDescription ( ) ;
35-
36- [ Name ( "secondary_position" ) , Index ( 7 ) ]
37- public int ? SecondaryPositionNumber { get ; set ; }
38-
39- [ Name ( "secondary_position_name" ) , Index ( 8 ) ]
40- // ReSharper disable once UnusedMember.Global
41- public string ? SecondaryPosition => SecondaryPositionNumber . HasValue
42- ? ( ( BaseballPlayerPosition ) SecondaryPositionNumber ) . GetEnumDescription ( )
43- : null ;
44-
45- [ Name ( "games_batting" ) , Index ( 9 ) ]
46- public int GamesBatting { get ; set ; }
47-
48- [ Name ( "games_played" ) , Index ( 10 ) ]
49- public int GamesPlayed { get ; set ; }
50-
51- [ Name ( "at_bats" ) , Index ( 11 ) ]
52- public int AtBats { get ; set ; }
53-
54- [ Name ( "plate_appearances" ) , Index ( 12 ) ]
55- public int PlateAppearances => AtBats + Walks + SacrificeHits + SacrificeFlies + HitByPitch ;
56-
57- [ Name ( "runs" ) , Index ( 13 ) ]
58- public int Runs { get ; set ; }
59-
60- [ Name ( "hits" ) , Index ( 14 ) ]
61- public int Hits { get ; set ; }
62-
63- [ Name ( "singles" ) , Index ( 15 ) ]
64- public int Singles => Hits - Doubles - Triples - HomeRuns ;
65-
66- [ Name ( "doubles" ) , Index ( 16 ) ]
67- public int Doubles { get ; set ; }
68-
69- [ Name ( "triples" ) , Index ( 17 ) ]
70- public int Triples { get ; set ; }
71-
72- [ Name ( "home_runs" ) , Index ( 18 ) ]
73- public int HomeRuns { get ; set ; }
74-
75- [ Name ( "rbi" ) , Index ( 19 ) ]
76- public int RunsBattedIn { get ; set ; }
77-
78- [ Name ( "extra_base_hits" ) , Index ( 20 ) ]
79- public int ExtraBaseHits => Doubles + Triples + HomeRuns ;
80-
81- [ Name ( "total_bases" ) , Index ( 21 ) ]
82- public int TotalBases => Singles + ( 2 * Doubles ) + ( 3 * Triples ) + ( 4 * HomeRuns ) ;
83-
84- [ Name ( "stolen_bases" ) , Index ( 22 ) ]
85- public int StolenBases { get ; set ; }
86-
87- [ Name ( "caught_stealing" ) , Index ( 23 ) ]
88- public int CaughtStealing { get ; set ; }
89-
90- [ Name ( "walks" ) , Index ( 24 ) ]
91- public int Walks { get ; set ; }
92-
93- [ Name ( "strikeouts" ) , Index ( 25 ) ]
94- public int Strikeouts { get ; set ; }
95-
96- [ Name ( "hit_by_pitch" ) , Index ( 26 ) ]
97- public int HitByPitch { get ; set ; }
98-
99- [ Name ( "sacrifice_hits" ) , Index ( 27 ) ]
100- public int SacrificeHits { get ; set ; }
101-
102- [ Name ( "sacrifice_flies" ) , Index ( 28 ) ]
103- public int SacrificeFlies { get ; set ; }
104-
105- [ Name ( "errors" ) , Index ( 29 ) ]
106- public int Errors { get ; set ; }
107-
108- [ Name ( "passed_balls" ) , Index ( 30 ) ]
109- public int PassedBalls { get ; set ; }
110-
111- [ Name ( "plate_appearances_per_game" ) , Index ( 31 ) ]
112- public double PlateAppearancesPerGame => PlateAppearances / ( double ) GamesPlayed ;
113-
114- [ Name ( "on_base_percentage" ) , Index ( 32 ) ]
115- public double OnBasePercentage => ( Hits + Walks + HitByPitch ) /
116- ( double ) ( AtBats + Walks + HitByPitch + SacrificeFlies ) ;
117-
118- [ Name ( "slugging_percentage" ) , Index ( 33 ) ]
119- public double SluggingPercentage => ( Singles + ( 2 * Doubles ) + ( 3 * Triples ) +
120- ( 4 * HomeRuns ) ) / ( double ) AtBats ;
121-
122- [ Name ( "on_base_plus_slugging" ) , Index ( 34 ) ]
123- public double OnBasePlusSlugging => OnBasePercentage + SluggingPercentage ;
124-
125- [ Name ( "batting_average" ) , Index ( 35 ) ]
126- public double BattingAverage => Hits / ( double ) AtBats ;
127-
128- [ Name ( "babip" ) , Index ( 36 ) ]
129- public double BattingAverageOnBallsInPlay =>
130- ( Hits - HomeRuns ) / ( double ) ( AtBats - Strikeouts - HomeRuns + SacrificeFlies ) ;
131-
132- [ Name ( "at_bats_per_home_run" ) , Index ( 37 ) ]
133- public double AtBatsPerHomeRun => AtBats / ( double ) HomeRuns ;
134-
135- [ Name ( "strikeout_percentage" ) , Index ( 38 ) ]
136- public double StrikeoutPercentage => Strikeouts / ( double ) AtBats ;
137-
138- [ Name ( "walk_percentage" ) , Index ( 39 ) ]
139- public double WalkPercentage => Walks / ( double ) PlateAppearances ;
140-
141- [ Name ( "extra_base_hit_percentage" ) , Index ( 40 ) ]
142- public double ExtraBaseHitPercentage => ExtraBaseHits / ( double ) Hits ;
143-
144- // Caveat with this, the denominator should be subtracting intentional walks, but that data is not available
145- [ Name ( "wOBA" ) , Index ( 41 ) ]
146- public double WeightedOnBaseAverage => ( ( 0.69 * Walks ) + ( 0.72 * HitByPitch ) + ( 0.89 * Singles ) + ( 1.27 * Doubles ) +
147- ( 1.62 * Triples ) + ( 2.10 * HomeRuns ) ) / ( AtBats + Walks + SacrificeFlies + HitByPitch ) ;
148-
149- [ Name ( "ISO" ) , Index ( 42 ) ]
150- public double IsolatedPower => SluggingPercentage - BattingAverage ;
151-
152- [ Name ( "season_completion_date" ) , Index ( 43 ) ]
153- public DateTime ? CompletionDate { get ; set ; }
154-
155- [ Name ( "season_id" ) , Index ( 44 ) ]
156- public int SeasonId { get ; set ; }
157-
158- [ Name ( "season_num" ) , Index ( 45 ) ]
159- public int SeasonNum { get ; set ; }
160-
161- [ Name ( "age" ) , Index ( 46 ) ]
162- public int Age { get ; set ; }
163- }
17+ [ Ignore ]
18+ public int StatsPlayerId { get ; set ; }
19+ }
0 commit comments