All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- An additional case to the
DiceKit.Error
enum,.insufficientRollForCalculation(attempt:minimum:)
- More tests for
Rollable.roll(times:_:)
Rollable
roll(times:_:)
is now a throwing function
- The extension to
Array<Roll>
that provides the.sum
property is now an extension onSequence<Roll>
, which means it also works onArraySlice<Roll>
.
Rollable
- Fixed
roll(times:_:)
bugs when rulling too few times (closes #88)
- Fixed
0.26.0 — 2022-06-26
- Removed draft marker from automatic releases
- Various required cleanup tasks due to the deploy scripts not working imemdiately
0.25.5 — 2022-06-05
- The auto-release deployment name should now be correct
0.25.4 — 2022-06-04
- Continued debugging of automatic release deployment name
0.25.3 — 2022-06-04
- Continued debugging of auto-deployment
0.25.2 — 2022-06-04
- Continued debugging of auto-deployment
0.25.1 — 2022-06-04
- Continued debugging of auto-deployment
0.25.0 — 2022-06-04
- Releases are now auto-deployed from GitHub Actions
- Extra checks in Danger
- Improve PR template and guidelines
- Danger now runs in GitHub Actions, not Travis CI
- Documentation is now auto-deployed from GitHub Actions, not Travis CI
- We now test on Swift 4.2–5.6, and use the current allowed versions of macOS and Ubuntu
- Extra now-obsolete GitHub Actions
- All uses of Travis CI are now gone
0.24.1 — 2020-10-15
- Danger now reports tasks in the correct order
0.24.0 — 2020-07-13
Chance
objects can now be multiplied together (which, mathematically, represents the chance of both occurring)- More test cases for
Chance
Dice
probabilities computation is now up to 1000x faster (in my tests). From the user's perspective, nothing else about this should have changed.- The release script now links to the docs for the specific version (on the releases page), not just the main website.
- GitHub Actions can now deploy docs through the use of the GitHub token
- Typos
0.23.0 — 2020-07-09
- A
[email protected]
file in order to be able to specify supported platforms - Supported versions of Swift are listed in the package manifest file
- Migrate from
Array.index(of:)
toArray.firstIndex(of:)
- Continue to define our own implementation of
count(where:)
until at least Swift 6, because (as I found out) the implementation in the standard library was removed because of its impact on type-checker performance. - Makes the GitHub Actions workflow output nicer.
- Uses the correct Swift version in GitHub Actions tests (closes #80)
0.22.0 — 2020-07-02
- More documentation on the
chances
property introduced in v0.21.0 Dice
caches the result of its computations forprobabilities
between objects (closes #78). See the issue (linked) or the pull request here for more information on caching.Dice
now conforms toHashable
(adding for caching, but handy in general)
0.21.0 — 2020-07-01
- The internal
Chances
property formerly nameddict
(of type[Roll: Chance]
) is now public and namedchances
. - Adds GitHub Actions for testing
- The GitHub pull request template now uses the
updateVersion.sh
andrelease.sh
scripts that were added in PR #66 (Version 0.18.0) - The Travis CI configuration has had significant changes (none of which will impact users of the library):
- Now runs on Ubuntu 16.04 "Xenial" instead of 14.04 "Trusty" (matching the Travis default, and allowing for Swift 5.2.x)
- Tests on Swift 4.2.4, 5.0.3, 5.1.5, and 5.2.4 (Linux) and 4.2, 5.0.1, 5.1.3, and 5.2.4 (macOS). Previously, it tested on 4.2.4, 5.0.3, and 5.1.3 on both. I would have preferred to use versions tested on Linux on macOS as well, but the current versions are bundled with Xcode, noticeably speeding up builds
- Prints the Swift version (mostly to help because of the above point)
- Updates the Dangerfile
- The behavior around adding tests has become more lenient (warnings instead of errors, so that there is less need to change spacing on files to get past Danger)
- Danger now checks the body of the PR for empty checkboxes, which should allow me to replace
task-list-completed
. It should also present better (failing the check instead of making it say "in progress")
- Updates the README to show the latest Swift versions
- Fixes the
remove_dev_dependencies
script. It turns out that this script had never worked (I don't think), but the place that it was running in CI meant that it didn't matter. It will now work when running on a local machine, though. Note: this may be becoming irrelevant, as I believe some related feature is coming to a new version of Swift. However, as we currently support as old as 4.2.4, it'll probably be a while before we can drop these scripts completely.
0.20.2 — 2020-07-01
- Dice objects with no dice in them (i.e., modifiers only or empty objects) no longer crash when accessing their probabilities property (closes #75)
0.20.1 — 2020-06-30
DKError
/Error
'slocalizedDescription
field now has a useful value (based off of the documentation for those fields).
- [internal] Complies with best practices (not naming an untyped error in catch clauses; no effect for users).
- Documentation deployment is fixed.
- Errors thrown by
Die(sides:)
do not crashDice(_:String)
; instead, they are propagated up the call stack.
0.20.0 — 2020-02-16
- The structure of the GitHub Pages site has changed. There is now a
docs
directory, with subdirectories for each version. The auto-deployment of documentation has been updated to support this.
0.19.0 — 2019-12-26
- Scripts to hide/unhide dev dependencies
- Documentation will no longer force-push; instead it will update
- Safety checks were removed from the release script
- Dev dependencies, such as Danger, are now only included, downloaded, and built on CI
0.18.1 — 2019-08-22
- The release script has been fixed (closes #67)
- The automatic documentation has been fixed
0.18.0 — 2019-08-04
- Add release.py and updateVersion.py scripts
- Add Danger integration
- Checks that PRs to master have Version X.Y.Z: $DESCRIPTION as their title
- Checks that there are changes to the CHANGELOG
- Checks that the latest date is the date that the PR is merged (technically the date of the last Travis build)
- Checks that there are changes in tests files when source files are changed
- Checks that
swift test --generate-linuxmain
is run when new tests are written
- Ensure that all structs conform to a new type,
Describable
(CustomStringConvertible & CustomDebugStringConvertible
)
- All classes were converted to structs
- Moves everything to one pull request template so that it comes up by default
- The image on the generated documentation is no longer cut off
- Ensures that a pull request template is applied
Update .travis.yml in case https://swiftenv.fuller.li/install.sh is down/has no SSL certificate
0.17.0 — 2019-07-26
- New feature guidelines
- Issue and pull request templates
Rollable
chance(of:_:)
probabilities
— property of typeChances
chance(of:)
for rolling in ranges
CustomDie
chance(of:)
for a specific possibility
Chance
gcd(_:_:)
andlcm(_:_:)
+
,-
, and+=
operatorsnormalized
— proportionally scales every Chance until the sum is 1
Chances
- No longer has entries in the dictionary for
Roll
s where theChance
is 0
- No longer has entries in the dictionary for
- Latest compatible version links to refer to releases rather than the tree at the specified tag
Rollable
roll(times:_:)
would crash when called like so:roll(times: 1, .dropOutsides)
0.16.1 — 2019-06-24
- Testing on Swift 5.0.1 and Xcode 10.2
- Auto-deploying docs
0.16.0 — 2019-06-24
CustomDie
DieSide
Error
WeightedDie
Chances
Chance
- More documentation
- Hound support
- SwiftLint support
- Changed failable initializers into throwing initializers
- Moved
roll(times:_:)
from theRollable
classed into an extension to the protocol; this makes it the default implementation. This has no impact on end users. - Makes Swift 4.2 the minimum version of Swift
- Support for Swift 4.0 through Swift 4.1.3
0.15.0 — 2018-12-02
- CODE_OF_CONDUCT.md
- CONTRIBUTING.md
Rollable
averageResult
by @TauficanReach(_:_:)
: determines whether the given rollable can reach the target, using the given roll comparison type
Die
doubleAverageResult
by @Taufi
RollComparison
: denotes the comparison to use in `canReach(::)
- Linux random on versions of Swift before 4.2
Dice
- Include modifiers in
Dice
addition functions - Properly multiply
Die
s inDice
multiplication functions.
- Include modifiers in
0.14.1 — 2018-11-15
Die
- Die rolling bug (#44): All dice Swift 4.2+ were being treated as
d6
s by @Taufi
- Die rolling bug (#44): All dice Swift 4.2+ were being treated as
0.14.0 — 2018-10-31
Die
init?(_ str: String)
: String parsing
Dice
init?(_ str: String)
: String parsing
0.13.0 — 2018-10-11
- Changed LICENSE from MIT to AFL v3.0
0.12.0 — 2018-10-09
- Logo by @richardbmx
0.11.0 — 2018-10-1
- More documentation
0.10.0 — 2018-09-29
- Automatic documentation deployment for the latest version
0.9.0 — 2018-09-28
- Linux support
0.8.0 — 2018-09-22
- Changed
Roll
toInt
typealias
0.7.0 — 2018-09-22
- LICENSE
- Swift 4.2/Xcode 10 compatibility
0.6.0 — 2018-09-17
Dice
init(_ die: Die, count: Int)
init(_ dieIntTuples: (die: Die, count: Int)...)
init(_ die: Die, count: Int, withModifier modifier: Int)
init(_ dieIntTuples: (die: Die, count: Int)..., withModifier modifier: Int)
- Addition operators for
Dice
and(Die, Int)
+=
forDice
and(Die, Int)
Die
- Addition operators for
Die
and(Die, Int)
->Dice
- Addition operators for
0.5.0 — 2018-09-13
Rollable
roll(times:_:)
: rolls a given number of times and performs the given operation on them.
MultipleRollResult
: denotes the operation to do onroll(times:_:)
public typealias DKMultipleRollResult = MultipleRollResult
0.4.0 — 2018-09-12
- Typealiases
public typealias DKDie = Die
public typealias DKDice = Dice
public typealias DKRoll = Roll
public typealias DKRollable = Rollable
0.3.0 — 2018-09-11
Die
- multiplication operators for
Die
andInt
that returnDice
- multiplication operators for
Dice
- multiplication operators for
Dice
andInt
that returnDice
- multiplication operators for
0.2.0 — 2018-09-02
Dice
numberOfDice
: the number ofDie
s in the object
Rollable
minimumResult
: the lowest possible rollmaximumResult
: the highest possible roll
0.1.0 — 2018-09-01
Die
: class; conforms toRollable
Dice
: class; conforms toRollable
Roll
: the result of rolling aRollable
Rollable
: a protocol for anything that is rollable