Ejemplo n.º 1
0
        private static void removePlayerAfterOut(Player player)
        {
            if (player.BaseLocation < 0)
            {
                frmBaseballSimulator.recordOut(-player.BaseLocation - 1);
                frmBaseballSimulator.clearCount();

                ScoreBoard.recordOut();

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

                dugOutQueue.Enqueue(player);
                onBaseList.Remove(player);
            }
            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;
            }

            Play.endPlay();
        }
Ejemplo n.º 2
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;
            }
        }