codebuddies / dungeonbuddies

Multi User Dungeon Coded by codebuddies slack members
MIT License
6 stars 3 forks source link

Refactor Dice model #18

Closed angelocordon closed 5 years ago

angelocordon commented 5 years ago

Refactor Dice model. Add RSpec testing framework. Update Docker and Gemfile to use Ruby 2.5.0.

angelocordon commented 5 years ago

@tyberious-1 - I want to propose some changes in how the Dice model could/should work based off of your PR (#15). The main change here is the way we may be able to use a Dice model to call Dice.roll in any situations.

By default, it will roll a one six-sided dice (we can change this to whatever we think makes sense), but if we ever need a D20 dice for example, we'd just use the method as follows:

Dice.roll(number_of_sides: 20)

Which will return us a value from a simulated one twenty-sided dice roll.

Thoughts?

tyberious-1 commented 5 years ago

A d6 is not really rolled that often a default d20 would be better

stain88 commented 5 years ago

Also, would a modifier be applied to each roll individually, or to the total sum? If the former, that could be a use-case for #simulate_roll, and tie in a min/max type thing.

tyberious-1 commented 5 years ago

Also, would a modifier be applied to each roll individually, or to the total sum? If the former, that could be a use-case for #simulate_roll, and tie in a min/max type thing.

The modifiers are applied to the total not to individual rolls.