mikron-ia / rpg-hub

An hub for RPG players and GMs, intended for storing and presenting campaign/epic information
GNU General Public License v3.0
1 stars 0 forks source link

Add flag/attribute/trait system #388

Open mikron-ia opened 4 months ago

mikron-ia commented 4 months ago

Currently, the only ways to add a configuration variable per object is to either introduce a 0/1 flag into the database (which would clutter the record) or to use a Parameter (which is not the intended use, is hardly intuitive, and clutters a different place).

Consider adding some flag/attribute/trait system that would allow an on/off configuration per object. First use could be in #58 for display as tab for Group functionality.

mikron-ia commented 4 months ago

A possible solution: a 1:1 to Epic and any other object that needs it ConfigPack object containing a JSON packed-configuration, unpacked in entity, accessed via getters, with all variables expected there (fed with defaults if absent).

Alternatively, not even a separate DB entry but just a JSON field within the object (with the same name across all objects), unpacked on use and packed on save by a trait-driven mechanism with a method ensured by HasConfig interface.

Possible issues: