Пример #1
0
        public int PointsFor(AmountOfItems <int> dices)
        {
            var equality      = IntEqualityByLiteral.Build();
            int amountOfFours = dices.AmountOf(4, equality);

            return(4 * amountOfFours);
        }
Пример #2
0
        public int PointsFor(AmountOfItems <int> dices)
        {
            var equality       = IntEqualityByLiteral.Build();
            int amountOfThrees = dices.AmountOf(3, equality);

            return(3 * amountOfThrees);
        }
Пример #3
0
        public Form1(IRandom randomness)
        {
            InitializeComponent();
            this.randomness = randomness;
            var equality = IntEqualityByLiteral.Build();

            dices = Dices <int> .Build(equality);

            for (int id = 0; id <= 6; id++)
            {
                var dice = Dice <int> .Build(id, 6, 1, false);

                dices.AddDice(dice);
            }

            calcAces   = Aces.Build();
            calcTwos   = Twos.Build();
            calcThrees = Threes.Build();
            calcFours  = Fours.Build();
            calcFives  = Fives.Build();
            calcSixes  = Sixes.Build();

            calcThreeOfKind   = ThreeOfKind.Build();
            calcFourOfKind    = FourOfKind.Build();
            calcFullHouse     = FullHouse.Build();
            calcSmallStraight = SmallStraight.Build();
            calcLargeStraight = LargeStraight.Build();
            calcYahzee        = Yahtzee.Build();
            calcChance        = Chance.Build();
        }
Пример #4
0
        public int PointsFor(AmountOfItems <int> dices)
        {
            int sumSoFar = 0;
            var equality = IntEqualityByLiteral.Build();

            for (int face = 1; face < 7; face++)
            {
                sumSoFar += dices.AmountOf(face, equality) * face;
            }

            return(sumSoFar);
        }