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); } }
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); } } }
public static void addLabelToBases() { nextLabelInLine = labelDugout.ElementAt(0); nextLabelInLine.Visible = true; onBaseLabels.Add(nextLabelInLine); labelDugout.Remove(labelDugout.ElementAt(0)); nextLabelInLine.BaseLocation = 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; }
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); } }
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); } } }
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); } } }
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); } } }
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); } } }
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(); } } }
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(); } }