rsek / datasworn

The successor to the original Datasworn repository and Dataforged package, which provide game rules from the Ironsworn and Ironsworn: Starforged TTRPGs in JSON.
https://ko-fi.com/r_sek
120 stars 26 forks source link

Move `OracleTableRow.min` and `OracleTableRow.max` to their own object in `OracleTableRow.roll` #26

Closed rsek closed 1 month ago

rsek commented 1 month ago

min and max can be null to represent unrollable rows that should be rendered for display purposes only. both properties must be of the same type. This is not possible to express in some languages, and awkward at best in JSON schema.

A better way to represent this is to make them their own object, and make that object nullable. min can't have a meaningful value without max, so the schema should reflect that.

The resulting RollRange schema may be reusable elsewhere, too. It might even inherit from a more basic IntegerRange schema used to construct e.g. condition meter-like schema.