Samasaur1 / DiceKit

A Swift module for simulating dice both real and unreal
https://samasaur1.github.io/DiceKit/
Academic Free License v3.0
4 stars 4 forks source link

Make Chance conform to Comparable #102

Open Samasaur1 opened 2 years ago

Samasaur1 commented 2 years ago

The Chance type should be Comparable. It definitely should be comparable to itself, probably to Doubles, and possibly even to Ints (allowing one to say myChance > 0).

Samasaur1 commented 2 years ago

30c71fc5f9884cddbccc9166349e846f35e21dc5 starts to address this

Samasaur1 commented 2 years ago

It makes Chance comparable to itself, and also to integers. It doesn't make it comparable to Double (or Float, I guess) because I wasn't sure whether to compare Chance.value with the double, or Chance(approximating:) with the chance.