public void ShowRandomScenario() { CurrentScenario = ScenarioArray[random.Next(ScenarioArray.Length)]; DealerUp_Image.Image = ImageArray[(int)CurrentScenario.DealerCard]; YourCardA.Image = ImageArray[(int)CurrentScenario.CardA]; YourCardB.Image = ImageArray[(int)CurrentScenario.CardB]; }
private void ActionButton_Click(object sender, EventArgs e) { int id = Int32.Parse((sender as Button).Tag.ToString()); PreviousScenario = new StrategyScenario(CurrentScenario.DealerCard, CurrentScenario.CardA, CurrentScenario.CardB, CurrentScenario.Answer); if (id == (int)CurrentScenario.Answer) { //Correct Answer NCorrect++; NTotal++; UpdateText(true); Correction_Label.Text = ""; View_Label.Text = ""; } else { NTotal++; UpdateText(false); Correction_Label.Text = "Correction: " + StringFromAction((int)CurrentScenario.Answer); View_Label.Text = "View"; View_Label.Tag = "" + CurrentScenario.DealerCard + " " + CurrentScenario.CardA + " " + CurrentScenario.CardB + " " + CurrentScenario.Answer; } ShowRandomScenario(); }
public StrategyReview(StrategyScenario sc, StrategyPractice sp) { InitializeComponent(); strategyScenario = sc; parent = sp; ImageArray = new Bitmap[] { new Bitmap(BJScore.Properties.Resources.Ace), new Bitmap(BJScore.Properties.Resources.Two), new Bitmap(BJScore.Properties.Resources.Three), new Bitmap(BJScore.Properties.Resources.Four), new Bitmap(BJScore.Properties.Resources.Five), new Bitmap(BJScore.Properties.Resources.Six), new Bitmap(BJScore.Properties.Resources.Seven), new Bitmap(BJScore.Properties.Resources.Eight), new Bitmap(BJScore.Properties.Resources.Nine), new Bitmap(BJScore.Properties.Resources.Ten), new Bitmap(BJScore.Properties.Resources.Jack), new Bitmap(BJScore.Properties.Resources.King), new Bitmap(BJScore.Properties.Resources.Queen) }; }
public StrategyPractice() { InitializeComponent(); ImageArray = new Bitmap[] { new Bitmap(BJScore.Properties.Resources.Ace), new Bitmap(BJScore.Properties.Resources.Two), new Bitmap(BJScore.Properties.Resources.Three), new Bitmap(BJScore.Properties.Resources.Four), new Bitmap(BJScore.Properties.Resources.Five), new Bitmap(BJScore.Properties.Resources.Six), new Bitmap(BJScore.Properties.Resources.Seven), new Bitmap(BJScore.Properties.Resources.Eight), new Bitmap(BJScore.Properties.Resources.Nine), new Bitmap(BJScore.Properties.Resources.Ten), new Bitmap(BJScore.Properties.Resources.Jack), new Bitmap(BJScore.Properties.Resources.King), new Bitmap(BJScore.Properties.Resources.Queen) }; //ScenarioArray = new StrategyScenario[] { new StrategyScenario(Card.Three, Card.Ace, Card.Seven, Action.DoubleDown) }; ScenarioArray = TextImport.Read(); CurrentScenario = ScenarioArray[0]; }