Do you want to work on this issue?
You can request for a bounty in order to promote it!
Custom enums: Allow of multiple values enhancement #3458
ChristianPervoelz posted onGitHub
Custom enums are a great and really easy way to define custom properties and by that create new templates/classes in a quick manner. But in some cases they might become confusing or may lead to errors. :(
In one of my projects I have defined an enum named Fruits
with (just an excerpt) values: apple, banana, peach and so on.
Now I have two custom classes: SingleFruit
(represents a single fruit) and PileOfFruits
(represents many fruits). Both have Fruits
as member.
The problem is now, that I have to check Allow mutiple values (flags) in the enum, as else I cannot easily have multiple entries for the PileOfFruits
class.
On the other hand, this allows the SingleFruit
class to have multiple values too, but that one should have one value at a time only (as the name says).
Idea It would be very great to have an additional option in custom types editor, that allows to set an enum member of a class to be either multi-value or single-value.
Alternatives There is a couple of alternatives, of course:
- create a second enum with the same values (and different name), not allowing multi selection (could become quite messy, easily)
- don't use the enum at all (would be a pitty)
- being careful, what is selected for
SingleFruit
;)