Open Samasaur1 opened 4 years ago
Especially considering that we convert the dice
dictionary to an array before performing calculations anyway:
and when rolling we need to "expand" the dictionary anyway:
I see no reason why we shouldn't convert the dice
dictionary to (presumably) an any Rollable
array
Is your feature request related to a problem? Please describe.
It doesn't make a lot of sense that
WeightedDie
cannot be used inDice
, and in a larger sense why anyRollable
can't be.Rollable
requires implementations of what I'm pretty sure are all the rolling/probabilities methods thatDie
has thatDice
uses. It requires looking into, and refactoring some parts ofDice
, but it seems like an overdue feature.Describe the solution you'd like:
Users should be able to use and
Rollable
type inDice
. This includes the initializers (probably excluding the dice notation String-based initializer), operators, and pretty much everywhere else.Describe alternatives you've considered:
Maybe
Dice
should only allowWeightedDie
/Rollable
types that I define, but that seems overly restrictive. That's what having a protocol is for.