public DieRollResult CountPoints(DiceRoll diceRoll) { if (IsApplicable(diceRoll)) { return(new DieRollResult(DiceCombination.FiveOfAKind, _points)); } return(DieRollResult.Default()); }
public DieRollResult CountPoints(DiceRoll diceRoll) { if (!IsApplicable(diceRoll)) { return(DieRollResult.Default()); } return(Combination(diceRoll)); }
public DieRollResult CountPoints(DiceRoll diceRoll) { if (IsApplicable(diceRoll)) { return(new DieRollResult(DiceCombination.FullHouse, _points)); } else { return(DieRollResult.Default()); } }
public DieRollResult CountPoints(DiceRoll diceRoll) { if (IsApplicable(diceRoll)) { return(new DieRollResult(DiceCombination.ThreeOfAKind, GetPoints(diceRoll))); } else { return(DieRollResult.Default()); } }
public DieRollResult CountPoints(DiceRoll diceRoll) { var dice = diceRoll.AllDice.ToIntArray().OrderBy(x => x).ToArray(); if (dice.Distinct().Count() != 5) { return(DieRollResult.Default()); } else { if (dice.Any((x => x == (int)DieRoll.One)) && IsSequenceConsecutive(dice)) { return(new DieRollResult(DiceCombination.StraightLow, _points)); } else if (IsSequenceConsecutive(dice)) { return(new DieRollResult(DiceCombination.StraightHigh, _points)); } else { return(DieRollResult.Default()); } } }