Skip to content

Feature Request: public function to parse RootType with provided DiceRollResult #11

@frankieali

Description

@frankieali

This is a feature request to add a new public function to parse previously parsed dice roll input strings (RootType) along with a provided DiceRollResult object so it can be parsed into a final RollBase object.

The application here is that I have created a 3D dice roller (using BabylonJS) that is capable of rolling dice on a canvas element and returns the face up value of the die rolled. I'd like to be able to return a "previously parsed dice roll input string" along with the roll results as an array of DiceRollResult objects to then have dice-roller-parser compute the final RollBase object. I really enjoy all the features of this package and would like to leverage it for my app.

Based on a quick review of the code, I think a good approach may be to allow the private RollType function to accept another argument of rolls: DiceRollResult that it can then pass onto the various rollType function. Then, if the rolls argument is undefined, rolls will be calculated by generateDiceRoll. Otherwise it will use the provided object. Is this feasible?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions