Exemple #1
0
        private static void advanceRunner(RunnerLabel runner)
        {
            //if (onBaseLabels.ElementAt(i).Top >= 240 && onBaseLabels.ElementAt(i).Left >= 514 && onBaseLabels.ElementAt(i).Visible)
            if (runner.BaseLocation == 0)
            {
                moveToFirst(runner);
            }
            //else if (onBaseLabels.ElementAt(i).Top <= 240 && onBaseLabels.ElementAt(i).Left > 514 && onBaseLabels.ElementAt(i).Visible)
            else if (runner.BaseLocation == 1)
            {
                moveToSecond(runner);
            }

            //else if (onBaseLabels.ElementAt(i).Top <= 240 && onBaseLabels.ElementAt(i).Left <= 514 && onBaseLabels.ElementAt(i).Visible)
            else if (runner.BaseLocation == 2)
            {
                moveToThird(runner);
            }

            //else if (onBaseLabels.ElementAt(i).Top >= 240 && onBaseLabels.ElementAt(i).Left <= 512 && onBaseLabels.ElementAt(i).Visible)
            else if (runner.BaseLocation == 3)
            {
                moveToHome(runner);
            }
        }
Exemple #2
0
        private static void moveToHome(RunnerLabel lbl)
        {
            if (lbl.Left < 512)
            {
                lbl.Top  += 1;
                lbl.Left += 1;
            }
            else
            {
                lbl.BaseLocation = 4;
                basesCrossed    += 1;
                addLabelToDugout(lbl);

                if (walkRunnersList.Contains(lbl))
                {
                    walkRunnersList.Remove(lbl);
                }

                if (onBaseLabels.Contains(lbl))
                {
                    labelDugout.Add(lbl);
                    onBaseLabels.Remove(lbl);
                }
            }
        }
Exemple #3
0
 public static void addLabelToBases()
 {
     nextLabelInLine         = labelDugout.ElementAt(0);
     nextLabelInLine.Visible = true;
     onBaseLabels.Add(nextLabelInLine);
     labelDugout.Remove(labelDugout.ElementAt(0));
     nextLabelInLine.BaseLocation = 0;
 }
Exemple #4
0
 private static void formatRunnerLabels(RunnerLabel lbl)
 {
     lbl.BringToFront();
     lbl.BackColor   = Color.Blue;
     lbl.Height      = 16;
     lbl.Width       = 17;
     lbl.AutoSize    = false;
     lbl.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
 }
Exemple #5
0
 private static void addLabelToDugout(RunnerLabel lbl)
 {
     if (onBaseLabels.Contains(lbl))
     {
         lbl.Visible      = false;
         lbl.Top          = 306;
         lbl.Left         = 514;
         lbl.BaseLocation = 10;
         labelDugout.Add(lbl);
         onBaseLabels.Remove(lbl);
     }
 }
Exemple #6
0
        private static void moveToThird(RunnerLabel lbl)
        {
            if (lbl.Top < 235)
            {
                lbl.Top  += 1;
                lbl.Left -= 1;
            }
            else
            {
                lbl.BaseLocation = 3;
                basesCrossed    += 1;

                if (walkRunnersList.Contains(lbl))
                {
                    walkRunnersList.Remove(lbl);
                }
            }
        }
Exemple #7
0
        private static void moveToSecond(RunnerLabel lbl)
        {
            if (lbl.Left > 514)
            {
                lbl.Top  -= 1;
                lbl.Left -= 1;
            }
            else
            {
                lbl.BaseLocation = 2;
                basesCrossed    += 1;

                if (walkRunnersList.Contains(lbl))
                {
                    walkRunnersList.Remove(lbl);
                }
            }
        }
Exemple #8
0
 private static void moveToThirdHalf(RunnerLabel lbl)
 {
     if (lbl.Left <= 482)
     {
         counter  += 1;
         lbl.Top  += 1;
         lbl.Left += 1;
     }
     else if (lbl.BaseLocation != 10)
     {
         if (lbl.BaseLocation == playerOutBaseLocation)
         {
             recordOut(lbl.BaseLocation);
         }
         else
         {
             moveToHome(lbl);
         }
     }
 }
Exemple #9
0
        private static void moveToFirst(RunnerLabel lbl)
        {
            if (lbl.Top >= 239)
            {
                counter  += 1;
                lbl.Top  -= 1;
                lbl.Left += 1;
            }
            else
            {
                lbl.BaseLocation = 1;


                basesCrossed += 1;

                if (walkRunnersList.Contains(lbl))
                {
                    walkRunnersList.Remove(lbl);
                }
            }
        }
Exemple #10
0
        private static void moveToSecondHalf(RunnerLabel lbl)
        {
            if (lbl.Top < 205)
            {
                counter  += 1;
                lbl.Top  += 1;
                lbl.Left -= 1;
            }
            else if (lbl.BaseLocation != 3)
            {
                if (lbl.BaseLocation == playerOutBaseLocation)
                {
                    recordOut(lbl.BaseLocation);
                }
                else
                {
                    moveToThird(lbl);
                }
            }

            if (lbl.BaseLocation == 3)
            {
                if (!setRunnersList.Contains(lbl))
                {
                    setRunnersList.Add(lbl);
                }

                if (setRunnersList.Count == onBaseLabels.Count)
                {
                    advanceHalfTimer.Stop();
                    clearCount();
                    setRunnersList.Clear();
                    totalNumToAdvance = 0;
                    basesCrossed      = 0;
                    Play.endPlay();
                }
            }
        }
Exemple #11
0
        private static void walkForcedRunners(RunnerLabel lbl)
        {
            //if(intMoveOneBase > 0)
            //{
            if (walkRunnersList.Contains(lbl))
            {
                for (int i = 0; i < walkRunnersList.Count; i++)
                {
                    //if (onBaseLabels.ElementAt(i).Top >= 240 && onBaseLabels.ElementAt(i).Left >= 514 && onBaseLabels.ElementAt(i).Visible)
                    if (walkRunnersList.ElementAt(i).BaseLocation == 0)
                    {
                        moveToFirst(walkRunnersList.ElementAt(i));
                    }
                    //else if (walkRunnersList.ElementAt(i).Top <= 240 && walkRunnersList.ElementAt(i).Left > 514 && walkRunnersList.ElementAt(i).Visible)
                    else if (walkRunnersList.ElementAt(i).BaseLocation == 1)
                    {
                        moveToSecond(walkRunnersList.ElementAt(i));
                    }

                    //else if (walkRunnersList.ElementAt(i).Top <= 240 && walkRunnersList.ElementAt(i).Left <= 514 && walkRunnersList.ElementAt(i).Visible)
                    else if (walkRunnersList.ElementAt(i).BaseLocation == 2)
                    {
                        moveToThird(walkRunnersList.ElementAt(i));
                    }

                    //else if (walkRunnersList.ElementAt(i).Top >= 240 && walkRunnersList.ElementAt(i).Left <= 512 && walkRunnersList.ElementAt(i).Visible)
                    else if (walkRunnersList.ElementAt(i).BaseLocation == 3)
                    {
                        moveToHome(walkRunnersList.ElementAt(i));
                    }
                }
            }
            else
            {
                walkBattersTimer.Stop();
            }
        }