Class Game2
java.lang.Object
Game2
Plays one or more games. Requires Lineup codes to play.
List of some Team Codes.
List of some Team Codes.
2024 Philadelphia Phillies 242700 2024 Atlanta Braves 242400 1967 Atlanta Braves 672400 1967 New York Mets 672601 1967 Baltimore Orioles 670100 1967 Los Angeles Dodgers 672500 1967 Cleveland Indians 6704137 Tiant 25 1967 Chicago Cubs 672200 1967 Cincinnati Reds 672300 1967 Pittsburg Pirates 672800 1967 Cleveland Indians 6704035 McDowell 20
- Version:
- 9-28-24
- Author:
- L Kedigh
-
Field Summary
Modifier and TypeFieldDescriptionint
Home cumulative ERRORSint
Home cumulative HITSint
HOME cumulative score to the current inningint
Counter which determines which side is battingint
Visitor cumulative ERRORSint
Visitors cumulative HITSint
VISITOR cumulative score to the current inningint
Index in the batting order of the current HOME batterLineUp
HOME Line UpPitcher
HOME starting pitcherArrayList of the HOME team's score by inningint
Inning of the gameOutcome of the Appearancestatic boolean
Flag to send stats to the output.int[]
Limits seperating walk,overs,corners,strikeoutResult of the pitch from the overs and corners chartsfinal String[]
One of four possible outcomes off the Pitching Chart: Overs, Corners, walk, strike outstatic boolean
Flag to send the appearance outcome to the monitorstatic boolean
Flag to send the Choice on FC outcome to the monitorstatic int
current team ERRORSstatic int
current team HITSstatic int
current team OUTSstatic int
current team RUNSint
Index in the batting order of the current VISITOR batterPitcher
VISITOR starting pitcherArrayList of the VISITOR team's score by inning -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetPitchRollResult
(Pitcher p, PositionPlayer b) First roll using the pitching chart, determines and returns WALK,OVERS,CORNERS, or STRIKE OUT.void
play
(int numOfGames, int vID, int hID) Plays one or more games.
-
Field Details
-
outputStats
public static boolean outputStatsFlag to send stats to the output. -
showAppearanceOutcomeST
public static boolean showAppearanceOutcomeSTFlag to send the appearance outcome to the monitor -
showPauseAfterOutcomeST
public static boolean showPauseAfterOutcomeSTFlag to send the Choice on FC outcome to the monitor -
teamOutsST
public static int teamOutsSTcurrent team OUTS -
teamRunsST
public static int teamRunsSTcurrent team RUNS -
teamErrorsST
public static int teamErrorsSTcurrent team ERRORS -
teamHitsST
public static int teamHitsSTcurrent team HITS -
pitchRollResults
One of four possible outcomes off the Pitching Chart: Overs, Corners, walk, strike out -
pitchChartLimits
public int[] pitchChartLimitsLimits seperating walk,overs,corners,strikeout -
vCurrentBatterIndex
public int vCurrentBatterIndexIndex in the batting order of the current VISITOR batter -
hCurrentBatterIndex
public int hCurrentBatterIndexIndex in the batting order of the current HOME batter -
visitingPitcher
public Pitcher visitingPitcherVISITOR starting pitcher -
homeLineUp
public LineUp homeLineUpHOME Line Up -
homePitcher
public Pitcher homePitcherHOME starting pitcher -
cvScore
public int cvScoreVISITOR cumulative score to the current inning -
chScore
public int chScoreHOME cumulative score to the current inning -
cvHits
public int cvHitsVisitors cumulative HITS -
chHits
public int chHitsHome cumulative HITS -
cvErrors
public int cvErrorsVisitor cumulative ERRORS -
chErrors
public int chErrorsHome cumulative ERRORS -
vScore
ArrayList of the VISITOR team's score by inning -
hScore
ArrayList of the HOME team's score by inning -
inn
public int innInning of the game -
counter
public int counterCounter which determines which side is batting -
pitchResult
Result of the pitch from the overs and corners charts -
outcome
Outcome of the Appearance
-
-
Constructor Details
-
Game2
public Game2()
-
-
Method Details
-
play
public void play(int numOfGames, int vID, int hID) Plays one or more games.- Parameters:
numOfGames
- The number of game to be played.vID
- Visiting Team ID number.hID
- Home Team ID number.
-
getPitchRollResult
First roll using the pitching chart, determines and returns WALK,OVERS,CORNERS, or STRIKE OUT.
The first chart I call the pitching chart.
Two dice determine if the batter is walked (WALK) or struck out(STRIKE OUT) which ends the appearance.
CORNERS and OVERS results in more throws of dice and additional charts.- Parameters:
p
- The Pitcher in the appearance.b
- The Batter in the appearance.- Returns:
- returns one of the following- WALK,OVERS,CORNERS, or STRIKE OUT
-