tkjn / GameTable

Online Game Table. The aims will be partially driven by the desire to use this software for gameplay similar to Warhammer Quest.
0 stars 1 forks source link

Dice macro: Be able to reference attributes #41

Open dezzak opened 7 years ago

dezzak commented 7 years ago

It would be good to be able to reference attributes, specifically on your character in the dice macros

tkjn commented 7 years ago

I do have some ideas for this. Thinking we could have some kind of Attribute Registry, where both core components and plugin can register the attributes they own. They could also fire an Attribute Changed Event when an attribute they own changes.

Other components/plugins can then determine what attributes are available, get their value and subscribe to the change event for an attribute.

Something we would have to consider in future is how to handle multiple plugins providing an identically named attribute, perhaps blocking loading a plugin if it conflicts would make sense.

This is kind of rough, but what do you think?

dezzak commented 7 years ago

Namespaces should help. Prefix every attribute name with the plugin name? Might want to include a human friendly name though

On 31 May 2017 20:58, "TKJN" notifications@github.com wrote:

I do have some ideas for this. Thinking we could have some kind of Attribute Registry, where both core components and plugin can register the attributes they own. They could also fire an Attribute Changed Event when an attribute they own changes.

Other components/plugins can then determine what attributes are available, get their value and subscribe to the change event for an attribute.

Something we would have to consider in future is how to handle multiple plugins providing an identically named attribute, perhaps blocking loading a plugin if it conflicts would make sense.

This is kind of rough, but what do you think?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/tkjn/GameTable/issues/41#issuecomment-305299430, or mute the thread https://github.com/notifications/unsubscribe-auth/ADLSLIXG9n9Cf2o6EVSgM8a11BRFeFmeks5r_cZegaJpZM4Nq0r7 .

tkjn commented 7 years ago

Namespaces should help. Prefix every attribute name with the plugin name? Sounds good.

Might want to include a human friendly name though In the dice macro reference you ideally want to reference the human friendly name. Do we namespace these as well? Do they have to be unique?