boardgame icon indicating copy to clipboard operation
boardgame copied to clipboard

A way for a Enum property to express to struct inflater a property that's not tied to a struct tag

Open jkomoros opened this issue 4 years ago • 0 comments

For example, the behaviors.Color hard-codes that the enum is Color. Ideally you could have some way for a struct inflater to inspect the field and get more information about it, and that information could be plumbed in from elsewhere. (Note: things are passed to NewStructInflater when they aren't even part of an exampleState, so you'd need to figure out where to stick them). This could allow you to have different enums used.

It could also allow a behavior.ProposedEnum that could be set to a specific enum live, and not hard-coded within the behavior. (But then you could only have one enum taht could be proposed by the player).

Perhaps the mechanism is as simple as a struct tag on the behavior that can be inspected by struct inflater, not just the leaf property.

Thought of while thinking about #752

jkomoros avatar Jul 30 '20 02:07 jkomoros