예제 #1
0
        public Task <DiceRollResult> Roll(string expression)
        {
            var parser           = DiceNotationParser.FromString(expression);
            var visitor          = new DiceNotationVisitor(_diceRng);
            var expressionResult = visitor.VisitNotation(parser.notation());
            var diceRollResult   = new DiceRollResult(visitor.DiceRolls, expressionResult);

            return(Task.FromResult(diceRollResult));
        }