RolePlayingCore
RolePlayingCore copied to clipboard
UnitCurrency.baseUnit() requires initialization from load() otherwise it unwraps nil
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