Skip to content

Better Override Model #39

@PersonTheCat

Description

@PersonTheCat

Cave Generator presets support this concept of default value overrides. What this means is that many generators have common fields with their own unique default values, but users can override those defaults to provide updated settings globally for a single preset.

For example, these two generators both contain a ceiling field:

caverns: {
  ceiling: { dummy: true, dummyOutput: 2.0 }
}
tunnels: {
  ceiling: { dummy: true, dummyOutput: 2.0 }
}

Users can consolidate this information by providing a top-level override, like this:

ceiling: { dummy: true, dummyOutput: 2.0 }
caverns: {}
tunnels: {}

This feature is implemented poorly. It currently works by defining a series of optional values inside of a common class model, but this has two main problems:

  • Incomplete coverage (which is confusing to the end user).
  • Poor efficiency.

It would be substantially simpler to just read from the top level JSON directly for any needed settings, which resolves both of the aforementioned issues. I am hoping for an update to personthecat.catlib.util.HjsonMapper before making this change.

Priority: lowish

Affected Areas:

  • OverrideSettings

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions