Class PitchingChart
java.lang.Object
PitchingChart
First Roll of the Simulation resulting in one of four outcomes "WALK","OVERS","CORNERS","STRIKE OUT".
WALK and STRIKE OUT ends the batter's plate appearance.
OVERS and CORNERS result in additonal rolls.
WALK and STRIKE OUT ends the batter's plate appearance.
OVERS and CORNERS result in additonal rolls.
- Version:
- 3-14-24
- Author:
- L Kedigh
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
getPitchRollResult
(int pitchingFactor, char battersBattingSide) First roll of the appearance resulting in either "WALK","OVERS","CORNERS","STRIKE OUT"static void
setPitchingLimits
(int pitchingFactor, char batterSide) Determines the pitching chart limits based on the pitcher's pitching factor and the side of the plate the hitter is hitting from.
-
Field Details
-
rnd
-
-
Constructor Details
-
PitchingChart
public PitchingChart()
-
-
Method Details
-
getPitchRollResult
First roll of the appearance resulting in either "WALK","OVERS","CORNERS","STRIKE OUT"- Parameters:
pitchingFactor
- Pitcher pitching factor, 10-29 inclusive.batSide
- Batter's side of the plate they hit from.- Returns:
- One of the following "WALK","OVERS","CORNERS","STRIKE OUT"
-
setPitchingLimits
public static void setPitchingLimits(int pitchingFactor, char batterSide) Determines the pitching chart limits based on the pitcher's pitching factor and the side of the plate the hitter is hitting from.
The limits represent the values that mark "WALK","OVERS","CORNERS","STRIKE OUT" results.
Example A pitching factor of 19 has different limits based on pitching to a left handed batter or a right handed batter.
A pitching factor of 19 will result in 190 for left handed batters, and 191 for right handed batters.
-