private void button1_Click(object sender, EventArgs e) { status = gameCraps.ThrowDice(); LoadDices(); lblPoint.Text = gameCraps.Point.ToString(); bet = Convert.ToDecimal(txtBet.Text); txtBet.Enabled = false; switch (status) { case Craps.Status.CONTINUE: break; case Craps.Status.WIN: MessageBox.Show("¡GANASTE!"); Calculate(); Reset(); break; case Craps.Status.LOSE: case Craps.Status.CRAPS: MessageBox.Show((status == Craps.Status.CRAPS ? "CRAPS!" : "LO SIENTO, HAS PERDIDO")); Calculate(); Reset(); break; } SetTitle(); }
private void Reset() { gameCraps.Reset(); status = Craps.Status.START; lblPoint.Text = string.Empty; pictureBox1.Image = Image.FromFile("dice_face_one.JPG"); pictureBox2.Image = Image.FromFile("dice_face_two.JPG"); bet = 0; txtBet.Enabled = true; }