Пример #1
0
        protected void YahtzeeBonuses()
        {
            //if you did not already save the bonus then continue on with the loop otherwise it is locked out for the rest of the game
            if (btnYahtzeeBonus.Enabled == true)
            {
                int fieldValue = 0;
                fieldValue = ytzDice.CalcXOfAKind(5, TestDice.gameDice);
                System.Diagnostics.Debug.WriteLine(fieldValue.ToString());
                if (Yahtzee > 0 && fieldValue > 0)
                {
                    btnYahtzeeBonus.Visible = true;
                    YahtzeeBonus           += 100;

                    yahtzeeBonusScoreValue.Text      = YahtzeeBonus.ToString();
                    yahtzeeBonusScoreValue.ForeColor = Color.Red;
                }
            }
        }
Пример #2
0
        protected void LoadCurrentScores()
        {
            if (acesSaved == true)
            {
                acesScoreValue.Text      = aces.ToString();
                acesScoreValue.ForeColor = Color.Black;
                btnAces.Enabled          = false;
                btnAces.Visible          = false;
            }

            if (twosSaved == true)
            {
                twosScoreValue.Text      = twos.ToString();
                twosScoreValue.ForeColor = Color.Black;
                btnTwos.Enabled          = false;
                btnTwos.Visible          = false;
            }

            if (threesSaved == true)
            {
                threesScoreValue.Text      = threes.ToString();
                threesScoreValue.ForeColor = Color.Black;
                btnThrees.Enabled          = false;
                btnThrees.Visible          = false;
            }
            if (foursSaved == true)
            {
                foursScoreValue.Text      = fours.ToString();
                foursScoreValue.ForeColor = Color.Black;
                btnFours.Enabled          = false;
                btnFours.Visible          = false;
            }
            if (fivesSaved == true)
            {
                fivesScoreValue.Text      = fives.ToString();
                fivesScoreValue.ForeColor = Color.Black;
                btnFives.Enabled          = false;
                btnFives.Visible          = false;
            }
            if (sixesSaved == true)
            {
                sixesScoreValue.Text      = sixs.ToString();
                sixesScoreValue.ForeColor = Color.Black;
                btnSixes.Enabled          = false;
                btnSixes.Visible          = false;
            }

            if (threeOfaKindSaved == true)
            {
                ThreeofKindScoreValue.Text      = ThreeofKind.ToString();
                ThreeofKindScoreValue.ForeColor = Color.Black;
                btnThreeKind.Enabled            = false;
                btnThreeKind.Visible            = false;
            }

            if (fourOfAKindSaved == true)
            {
                FourofKindScoreValue.Text      = fours.ToString();
                FourofKindScoreValue.ForeColor = Color.Black;
                btnFourKind.Enabled            = false;
                btnFourKind.Visible            = false;
            }
            if (fullHouseSaved == true)
            {
                fullHouseScoreValue.Text      = FullHouse.ToString();
                fullHouseScoreValue.ForeColor = Color.Black;
                btnFullHouse.Enabled          = false;
                btnFullHouse.Visible          = false;
            }
            if (smallStraightSaved == true)
            {
                smallStraightScoreValue.Text      = SmallStraight.ToString();
                smallStraightScoreValue.ForeColor = Color.Black;
                btnSmallStraight.Enabled          = false;
                btnSmallStraight.Visible          = false;
            }
            if (largeStraightSaved == true)
            {
                largeStraightScoreValue.Text      = LargeStraight.ToString();
                largeStraightScoreValue.ForeColor = Color.Black;
                btnLargeStraight.Enabled          = false;
                btnLargeStraight.Visible          = false;
            }
            if (YahtzeeSaved == true)
            {
                YahtzeeScoreValue.Text      = Yahtzee.ToString();
                YahtzeeScoreValue.ForeColor = Color.Black;
                btnYahtzee.Enabled          = false;
                btnYahtzee.Visible          = false;
            }
            if (ChanceSaved == true)
            {
                chanceScoreValue.Text      = Chance.ToString();
                chanceScoreValue.ForeColor = Color.Black;
                btnChance.Enabled          = false;
                btnChance.Visible          = false;
            }

            if (YahtzeeBonus > 0)
            {
                yahtzeeBonusScoreValue.Text      = YahtzeeBonus.ToString();
                yahtzeeBonusScoreValue.ForeColor = Color.Black;
                btnYahtzeeBonus.Enabled          = false;
                btnYahtzeeBonus.Visible          = false;
            }

            //check if upper bonus achieved
            UpperBonusCalc();
            if (UpperBonus == 35)
            {
                upperBonusScoreValue.Text      = UpperBonus.ToString();
                upperBonusScoreValue.ForeColor = Color.Black;
            }

            TotalScoreCalc();
        }