Exemple #1
0
    private void CheckWinConditions(Dice[] dice, int bet)
    {
        var diceRollValues = dice.Select(x => x.sideValue).ToArray();
        var result         = new ScoreRuleValidator().Validate(diceRollValues);

        Debug.Log($"Roll result\nFault: {result.IsFault}\nScore: {result.Score}\nMultiplier: {result.Multiplier}");
    }
Exemple #2
0
        public void all_different_no_win()
        {
            var validator      = new ScoreRuleValidator();
            var diceRollValues = new int[3] {
                1, 4, 5
            };

            var result = validator.Validate(diceRollValues);

            Assert.AreEqual(true, result.IsFault);
            Assert.AreEqual(0, result.Multiplier);
            Assert.AreEqual(0, result.Score);
        }