Skip to content

Commit 95f435d

Browse files
committed
RollResult's results are now list of RolledDie
introduce new object to hold roll results. among the fixes this will enable is exploding after a sum of heterogenous die `((1d6 + 1d8)-L)!`. it'll also enable roll rendering in client applications
1 parent 2694ed8 commit 95f435d

File tree

7 files changed

+934
-804
lines changed

7 files changed

+934
-804
lines changed

CHANGELOG.md

Lines changed: 73 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,46 @@
11
# 8.0.0
2+
23
## ⚠️⚠️ Breaking changes ⚠️⚠️
34

45
Roll results have changed significantly (again). It's amazing what having users will do to a package!
56

6-
77
## 📈 Enhancements
8+
89
- upgrade to dart 3.8.0
910
- upgrade to petitparser 7.0.0
11+
- remove metadata & score from RollResult
12+
- rather than simple list of Integers representing the output of a roll or operation, now each
13+
die rolled is a 'RolledDie' object which has the metadata/score.
14+
- RollResult.results will include both discarded an not-discarded RolledDie. TODO: change?
1015

1116
# 7.1.1
17+
1218
## 🛠️ Bug fixes
19+
1320
- fix typo in readme
1421

1522
# 7.1.0
1623

1724
## 📈 Enhancements
25+
1826
- upgrade to dart 3.6.0
1927
- add roll notation to support defining your own values. `1d[val1,val2,val3]`.
20-
For example, to roll 2 dice of primes under 20, use: `2d[2,3,5,7,11,13,17,19]`
21-
28+
For example, to roll 2 dice of primes under 20, use: `2d[2,3,5,7,11,13,17,19]`
2229

2330
# 7.0.3
2431

2532
## 🛠️ Bug fixes
33+
2634
- Previously, `4d6 + 3d6 #s #f` would only count success/failures of the 3d6 rolls, since counting
2735
had higher priority than the plus operation. You could workaround that with parens `(4d6 + 3d6) #s #f`
2836
In 7.0.3 and later, the counting operations now have the lowest priority.
2937

3038
# 7.0.2
39+
3140
- remove demo code accidentally added
3241

3342
# 7.0.1
43+
3444
- remove direct dependency on `meta`
3545

3646
# 7.0.0
@@ -42,175 +52,219 @@ a tree of results from evaluating the dice expression. See the README for exampl
4252
traverse the graph.
4353

4454
## 📈 Enhancements
55+
4556
- new API for registering roll listeners. see README.md
4657
- analysis cleanup and dep upgrades
4758

4859
## 🛠️ Bug fixes
49-
- propagate the roll metadata up to the top of the graph
5060

61+
- propagate the roll metadata up to the top of the graph
5162

5263
# 6.0.2
64+
5365
- more readme fixes
5466
- cleanup error handling / exceptions
5567

5668
# 6.0.1
69+
5770
- fix deprecation
5871
- minor readme language changes
5972

6073
# 6.0.0
74+
6175
- dart 3.0 requirement
6276
- upgrade deps
6377

6478
# 5.1.5
79+
6580
- clean up example documenation in README.md
6681

6782
# 5.1.4
83+
6884
- upgrade deps (lint)
6985

7086
# 5.1.3
87+
7188
- transfer repository to Adventuresmith org
7289

7390
# 5.1.2
91+
7492
- fix error messages with extraneous `'`
7593
- make examples in README less abstract
7694
- add method for json encoding roll result
7795

7896
# 5.1.1
97+
7998
- add syntax for exploding/compounding/reroll once
80-
- `4d6 !o`
81-
- `4d6 !!o`
82-
- `4d6 ro`
99+
- `4d6 !o`
100+
- `4d6 !!o`
101+
- `4d6 ro`
83102
- add syntax for success, failure, as well as crit success & failure.
84-
- `4d6 #s=6`
85-
- plain `#` counts results and transforms the expression from rolls into a count.
86-
- but `#s`, `#f`, `#cs`, `#cf` only add metadata to the roll result, and can be chained together.
87-
- `9d6! -= 3 #s>=5#f1#cs` -- roll 9d6 with exploding, drop any threes, count >=5 as success, 1s as failures, and 6 as critical success
103+
- `4d6 #s=6`
104+
- plain `#` counts results and transforms the expression from rolls into a count.
105+
- but `#s`, `#f`, `#cs`, `#cf` only add metadata to the roll result, and can be chained together.
106+
- `9d6! -= 3 #s>=5#f1#cs` -- roll 9d6 with exploding, drop any threes, count >=5 as success, 1s as failures, and
107+
6 as critical success
88108

89109
# 5.1.0
110+
90111
- make RollResult aggregate _all_ results for whole AST
91112

92113
# 5.0.0
114+
93115
- add compounding dice: `5d6!!`
94116
- add keep high/low: `2d20k`
95117
- add reroll: `10d4 r<=2`
96118
- allow exploding/compounding dice to have an rhs expression (>=,<=,=,<,>)
97119
- remove `!!` as 'limited explosion' (make it compounding, like Roll20 dice notation)
98-
- fix syntax for exploding dice (2d6!, not 2d!6).
99-
- remove exploding method from DiceRoller -- now it's part of the AST.
120+
- fix syntax for exploding dice (2d6!, not 2d!6).
121+
- remove exploding method from DiceRoller -- now it's part of the AST.
100122
- dice rolls return RollResult
101123
- clean up redundant parser config
102124

103125
# 4.1.0
126+
104127
- cleanup examples
105128
- add syntax for `>=` and `<=` for counts, drop, clamp
106129
- remove redundancy in parser defintion
107130

108131
# 4.0.6
132+
109133
- allow subtraction
110134

111135
# 4.0.5
136+
112137
- remove unused dev dependency
113138

114139
# 4.0.4
140+
115141
- fix typo in unit test
116142

117143
# 4.0.3
144+
118145
- increase test coverage -- test rollN and stats.
119146

120147
# 4.0.1
148+
121149
- add github actions, remove circleci
122150
- add codecov
123151

124152
# 4.0.0
153+
125154
- cleanup petitparser usage -- generate AST so that parsing the dice expression can be separate from rolling dice.
126155

127156
# 3.1.0
157+
128158
- remove subtraction
129159
- clean up add/mult -- don't collapse lists to ints
130-
- `[1,4,5] + 2` => `[1,4,5,2]`
131-
- `[1,4,5] * 2` => `[2,8,10]`
160+
- `[1,4,5] + 2` => `[1,4,5,2]`
161+
- `[1,4,5] * 2` => `[2,8,10]`
132162
- remove subtraction -- like division, too many corner cases
133163
- clean up error handling -- throw less often, less complex if/else statements.
134164

135165
# 3.0.3
136-
- update linter and fix analysis
166+
167+
- update linter and fix analysis
137168

138169
# 3.0.2
170+
139171
- fix circleci build
140172

141173
# 3.0.1
174+
142175
- minor analysis cleanup (dead code)
143176

144177
# 3.0.0
178+
145179
- upgrade deps & null safety
146180
- more error handling
147181

148182
# 2.0.1
183+
149184
- downgrade petitparser
150185

151186
# 2.0.0
187+
152188
- library upgrades including sdk >2.7.0
153189

154190
# 1.4.2
191+
155192
- use unmodifiable view return types
156193

157194
# 1.4.1
195+
158196
- fix return types of stats objects
159197

160198
# 1.4.0
199+
161200
- replace use of stats library w/ implementation of welford's algorithm.
162201
see http://alias-i.com/lingpipe/docs/api/com/aliasi/stats/OnlineNormalEstimator.html
163202
- make DiceParser.rollN an async generator returning stream of results
164203

165204
# 1.3.6
205+
166206
- allow lowercase for `-H`, `-L`, `C>`, `C<`
167207

168208
# 1.3.5
209+
169210
- back off petitparser dependency -- back off to 2.2.1,
170211
so that we don't have dependency on Dart 2.3.0
171212
(current stable flutter is 2.3.0-dev)
172213

173214
# 1.3.4
215+
174216
- make code more idiomatic
175217

176218
# 1.3.3
219+
177220
- make log fields non-public
178221

179222
# 1.3.2
223+
180224
- upgrade mockito dep
181225

182226
# 1.3.0
227+
183228
- add drop equals/less-than/greater-than
184229
- add cap/clamp
185230
- add counting operation
186231
- add exploding dice
187232

188233
# 1.2.2
234+
189235
- more logging and error handling cleanup
190236

191237
# 1.2.1
238+
192239
- more logging and error handling cleanup
193240

194241
# 1.2.0
242+
195243
- add dice stats to the parser
196244
- logging & error handling cleanup
197245

198246
# 1.1.2
247+
199248
- more tests and cleanup examples
200249

201250
# 1.1.1
251+
202252
- fix typo in readme
203253

204254
# 1.1.0
255+
205256
- add drop high/low parsing
206257

207258
# 1.0.2
259+
208260
- fix readme example
209261

210262
# 1.0.1
263+
211264
- fix readme issues
212265

213266
# 1.0.0
267+
214268
- bump min dart SDK to 2.2.2
215269
- cleanup parser code
216270
- cleanup analysis problems
@@ -219,12 +273,15 @@ traverse the graph.
219273
- flesh out API docs
220274

221275
# 0.2.2
276+
222277
- reformat
223278

224279
# 0.2.1
280+
225281
- upgrade some dependencies
226282

227283
# 0.2.0
284+
228285
- upgrade to dart 2
229286

230287
# 0.1.2

0 commit comments

Comments
 (0)