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.
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