Skip to content

Alternative to global static settings dictionary map for config #125

@nyanpasu

Description

@nyanpasu

Current implementation is a hash map with string keys to string values.

It's simple, but not effective.

Also a hash map is so fucking noob.

I propose creating a new class called SettingsOption, which will contain:

  • Name
  • Value
  • Description (optional)
  • Type (optional)
  • Permitted values (i.e range, string regex)
  • Callback functions that will be called when a change occurs (so that any function could register for changes in option)

This could allow the config file to be self documenting when it's first generated.

Even though most config options should be self documenting by name alone.

Along the way we could consider:

  • SettingSection (settingOption can be grouped by category)

The current Setting class will be replaced with a abstract Setting parent that will contain:

  • init
  • clean up
  • default
  • read/parse
  • write/update/generate

And other modules will inherit from it, adding their own options.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions