Example #1
0
        internal int Yahtzy(bool assign = false)
        {
            int points = 0;

            foreach (var item in OccurenceOfEachDice.Where(item => item.Value == 5))
            {
                points = 50;
                if (assign)
                {
                    Scoreboard["Yahtzy"] = points;
                }
            }

            return(points);
        }
Example #2
0
        internal int FourOfAKind(bool assign = false)
        {
            int points = 0;

            foreach (var item in OccurenceOfEachDice.Where(item => item.Value >= 4))
            {
                points = 4 * item.Key;
                if (assign)
                {
                    Scoreboard["Four Of A Kind"] = points;
                }
            }

            return(points);
        }
Example #3
0
        // Check if score is available based on occurence of each dice, and assigns to scoreboard if bool input is true, based on the player choice.
        internal int OnePair(bool assign = false)
        {
            int points = 0;

            foreach (var item in OccurenceOfEachDice.Where(item => item.Value >= 2))
            {
                points = 2 * item.Key;
                if (assign)
                {
                    Scoreboard["One Pair"] = points;
                }
            }

            return(points);
        }
Example #4
0
        internal int TwoPairs(bool assign = false)
        {
            int points        = 0;
            int tempPoints    = 0;
            int amountOfPairs = 0;

            foreach (var item in OccurenceOfEachDice.Where(item => item.Value >= 2))
            {
                amountOfPairs++;
                tempPoints += 2 * item.Key;
            }

            if (amountOfPairs < 2)
            {
                return(points);
            }
            points = tempPoints;
            if (assign)
            {
                Scoreboard["Two Pairs"] = points;
            }

            return(points);
        }