RolePlayingCore icon indicating copy to clipboard operation
RolePlayingCore copied to clipboard

UnitCurrency.baseUnit() requires initialization from load() otherwise it unwraps nil

Open mrlegowatch opened this issue 7 years ago • 0 comments

UnitCurrency requires being initialized from load() in order to allow customization for domain-specific currency (D&D 'coinage', space/future 'credits', etc.), but this means that baseUnit() can't return an unwrapped default currency if load() hasn't been called yet. The first loaded currency with a 'default' property wins.

Ideas to consider:

  • provide a default unit currency (e.g., "gp") whose symbol etc. can be overridden thru load()
  • allow the last loaded currency with a 'default' property to win

mrlegowatch avatar Feb 19 '17 16:02 mrlegowatch