Пример #1
0
        private static void removePlayerAfterOut(Player player, bool boolInfieldProgression, bool outfieldProgression)
        {
            int playerBaseLocation = player.BaseLocation;

            if (player == currentBatter)
            {
                ScoreBoard.Strikes = 0;
                ScoreBoard.Balls   = 0;
            }

            if (player.BaseLocation < 0)
            {
                if (boolInfieldProgression)
                {
                    ScoreBoard.recordOut();
                    frmBaseballSimulator.addPlayDescription();

                    Bases.ElementAt(-player.BaseLocation).isApproached = false;
                    player.BaseLocation = 10;

                    dugOutQueue.Enqueue(player);
                    onBaseList.Remove(player);

                    if (onBaseList.Count > 0)
                    {
                        setRunnersNewBase();
                    }

                    frmBaseballSimulator.startAdvanceHalfTimer(numToAdvance, true, -playerBaseLocation - 1);
                }
                else
                {
                    ScoreBoard.recordOut();
                    frmBaseballSimulator.addPlayDescription();

                    Bases.ElementAt(-player.BaseLocation).isApproached = false;
                    player.BaseLocation = 10;

                    dugOutQueue.Enqueue(player);
                    onBaseList.Remove(player);

                    if (onBaseList.Count > 0)
                    {
                        setRunnersNewBase();
                    }

                    frmBaseballSimulator.startAdvanceHalfTimer(numToAdvance, true, -playerBaseLocation - 1);
                }
            }
            else
            {
                frmBaseballSimulator.recordOut(player.BaseLocation);
                frmBaseballSimulator.clearCount();

                ScoreBoard.recordOut();

                Bases.ElementAt(player.BaseLocation + 1).isApproached = false;
                player.BaseLocation = 10;

                dugOutQueue.Enqueue(player);
                onBaseList.Remove(player);
            }

            if (player.Equals(currentBatter))
            {
                currentBatter = null;
            }
        }
Пример #2
0
        public static void newInning()
        {
            ScoreBoard.newInning();

            frmBaseballSimulator.newInning();
        }