Ejemplo n.º 1
0
        public void RollDice()
        {
            //Once the first roll has been made no more players can be added.
            form.DisableUpDown();
            for (int i = 0; i < dice.Length; i++)
            {
                dice[i].Roll();

                dieLabels[i].Text = dice[i].FaceValue.ToString();
            }

            if (numRolls == 0)
            {
                string message = "Roll 1";
                form.EnableAllButtons();
                // Turns off the already used scorebuttons.
                form.checkScoreButton();
                form.EnableCheckBoxes();
                form.ShowMessage(message);
            }

            if (numRolls == 1)
            {
                string message = "Roll 2 or choose a combination to score";
                form.ShowMessage(message);
            }

            if (numRolls == 2)
            {
                string message = "Roll 3, Your turn has ended - click OK";
                form.ShowMessage(message);
                form.DisableRollButtons();
                form.ShowOKButton();
            }

            numRolls++;
        }