Пример #1
0
        //---------------------------------------------------------------------------------------------------------------------------------------------------

        public void ScoreCombination(ScoreType combination)
        {
            currentPlayer.ScoreCombination(combination, faceValues);
            form.ShowOKButton();
            currentPlayer.ShowScores();

            if (currentPlayer.IsFinished())
            {
                playersFinished += 1;
            }
        }
Пример #2
0
        }//END ReleaseDie

        public void ScoreCombination(ScoreType score)
        {
            //Used to Show the correct message after the user selects scoring option.
            numRolls = 4;
            form.ShowMessage(ROLLMESSAGES[numRolls]);
            int[] dieValues = new int[5];
            for (int i = 0; i < 5; i++)
            {
                dieValues[i] = dice[i].FaceValue;
            }
            currentPlayer.ScoreCombinations(score, dieValues);
            form.ShowOKButton();
            form.UpdateGridView();
        }//END ScoreCombination
Пример #3
0
        }//end ReleaseDie

        /// <summary>
        /// This method calculates the score for the specified scoring combination
        /// </summary>
        /// <param name="combo">the score combination</param>
        public void ScoreCombination(ScoreType combo)
        {
            int[] dieValue = new int[5];
            for (int index = 0; index < 5; index++)
            {
                dieValue[index] = dice[index].FaceValue;
            }
            currentPlayer.ScoreCombination(combo, dieValue);
            form.ShowOKButton();
        }//end ScoreCombination
Пример #4
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++;
        }