-
-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Split output to separate module / library #132
Comments
Just a note on my thoughts at the moment: We can probably achieve this in a similar way to the RNG, where we have a separate class that you can call methods on: https://dice-roller.github.io/documentation/guide/customisation.html#random-number-generator So we'd have a class (e.g. The engine will have to have a public method (e.g. type ObjectTypes = RollResult | ResultGroup ...;
interface engine {
output<ReturnType>: (arg: ObjectTypes, context: { parent?: ObjectTypes | undefined }) => <ReturnType>
}
|
Is your feature request related to a problem? Please describe.
The roll output, that returns the string version of the roll log, is currently built in to the individual classes and is not easily changeable.
It could be helpful if the output was built as a separate module, so that it can be easily swapped out for a different output type. This would enable easier modification of the output and allow things like HTML output.
Describe the solution you'd like
Move the output functionality into it's own set of classes that can handle the various objects that need to be output.
It may be beneficial for this to be it's own library, rather than built in to the dice roller itself. The alternative is to simply build it inside the library as it's own set of modules.
The text was updated successfully, but these errors were encountered: