Skip to content
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

Add Negation type #63

Open
Samasaur1 opened this issue Jul 13, 2019 · 1 comment
Open

Add Negation type #63

Samasaur1 opened this issue Jul 13, 2019 · 1 comment
Labels
enhancement New feature or request

Comments

@Samasaur1
Copy link
Owner

Is your feature request related to a problem? Please describe.

It's not related to a problem, but a lack of functionality. There's no way to have a Die that can give negative results, and the only ways to do it (using Dice, CustomDie, or WeightedDie) are far too complicated to be used often.

Describe the solution you'd like:

A Negation<R: Rollable> class that negates any output from the Rollable. There should also be unary - operators for creating Negations from Rollables (and cancelling out multiple Negations.

Describe alternatives you've considered:

The class may not need to be generic; I haven't started to look at an implementation yet.

Additional context:

None

@Samasaur1 Samasaur1 added the enhancement New feature or request label Jul 13, 2019
@Samasaur1 Samasaur1 changed the title Add Negation<R: Rollable> type Add Negation type Jul 13, 2019
@Samasaur1
Copy link
Owner Author

The negation branch has some work on a non-generic Negation type (ending at 75c2e0a). It may need to be generic, so that the type returned from canceled Negations is the original type.

That said, I'm not completely sold on having a Negation struct. It feels like a makeshift patch that still leaves it very difficult to get negative numbers while still having full functionality (such as being put in Dice objects).

More consideration is required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant