Exemplo n.º 1
0
 private void scoreOnesButton_Click(object sender, EventArgs e)
 {
     scoreCard.Ones          = dice.getPossibleScores().Ones;
     scoreOnesButton.Visible = false;
     resetRolls();
 }
Exemplo n.º 2
0
        private void rollButton_Click(object sender, EventArgs e)
        {
            dice.roll();

            var possibleScores = dice.getPossibleScores();

            if (button1.Enabled)
            {
                onesScoreLabel.Text = possibleScores.Ones.ToString();
            }
            if (button2.Enabled)
            {
                twosScoreLabel.Text = possibleScores.Twos.ToString();
            }
            if (button3.Enabled)
            {
                threesScoreLabel.Text = possibleScores.Threes.ToString();
            }
            if (button4.Enabled)
            {
                foursScoreLabel.Text = possibleScores.Fours.ToString();
            }
            if (button5.Enabled)
            {
                fivesScoreLabel.Text = possibleScores.Fives.ToString();
            }
            if (button6.Enabled)
            {
                sixesScoreLabel.Text = possibleScores.Sixes.ToString();
            }
            if (scoreThreeOfAKind.Enabled)
            {
                threeOfAKindLabel.Text = possibleScores.ThreeOfAKind.ToString();
            }
            if (scoreFourOfAKind.Enabled)
            {
                fourOfAKindLabel.Text = possibleScores.FourOfAKind.ToString();
            }
            if (scoreFullHouse.Enabled)
            {
                fullHouseLabel.Text = possibleScores.FullHouse.ToString();
            }
            if (scoreSmallStraight.Enabled)
            {
                smallStraightLabel.Text = possibleScores.SmallStraight.ToString();
            }
            if (scoreLargeStraight.Enabled)
            {
                largeStraightLabel.Text = possibleScores.LargeStraight.ToString();
            }
            if (scoreYahtzee.Enabled)
            {
                yahtzeeLabel.Text = possibleScores.Yahtzee.ToString();
            }
            if (scoreChance.Enabled)
            {
                chanceLabel.Text = possibleScores.Chance.ToString();
            }

            if (dice.RollCount == 3)
            {
                rollButton.Enabled = false;
            }
        }
Exemplo n.º 3
0
        private void UpdatePossibleScoreLabels(YahtzeeDice dice)
        {
            if (scoreOnesButton.Visible)
            {
                onesScoreLabel.Text = dice.getPossibleScores().Ones.ToString();
            }
            if (scoreTwosButton.Visible)
            {
                twosScoreLabel.Text = dice.getPossibleScores().Twos.ToString();
            }
            if (scoreThreeButton.Visible)
            {
                threesScoreLabel.Text = dice.getPossibleScores().Threes.ToString();
            }
            if (scoreFoursButton.Visible)
            {
                foursScoreLabel.Text = dice.getPossibleScores().Fours.ToString();
            }
            if (scoreFivesButton.Visible)
            {
                fivesScoreLabel.Text = dice.getPossibleScores().Fives.ToString();
            }
            if (scoreSixesButton.Visible)
            {
                sixesScoreLabel.Text = dice.getPossibleScores().Sixes.ToString();
            }

            if (scoreThreeOfAKindButton.Visible)
            {
                threeOfAKindScoreLabel.Text = dice.getPossibleScores().ThreeOfAKind.ToString();
            }
            if (scoreFourOfAKindButton.Visible)
            {
                fourOfAKindScoreLabel.Text = dice.getPossibleScores().FourOfAKind.ToString();
            }
            if (scoreFullHouseButton.Visible)
            {
                fullHouseScoreLabel.Text = dice.getPossibleScores().FullHouse.ToString();
            }
            if (scoreSmallStraightButton.Visible)
            {
                smallStraightScoreLabel.Text = dice.getPossibleScores().SmallStraight.ToString();
            }
            if (scoreLargeStraightButton.Visible)
            {
                largeStraightScoreLabel.Text = dice.getPossibleScores().LargeStraight.ToString();
            }
            if (scoreYahtzeeButton.Visible)
            {
                yahtzeeScoreLabel.Text = dice.getPossibleScores().Yahtzee.ToString();
            }
            if (scoreChanceButton.Visible)
            {
                chanceScoreLabel.Text = dice.getPossibleScores().Chance.ToString();
            }
        }