Create "Autobuild fields from enum type param"
There weren't any great cookbook examples of the following things
- Using
@:autoBuildto generate fields. Even the manual page for autoBuild doesn't actually do anything practical - Getting type params from a type, specifically an
EnumValue - Get all values from an enum and inject them into code
I would also like to do this with @:genericBuild as there aren't many great resources for that either, but first, this may be a bit too meaty for a manual. I'm wondering if I should break it down into smaller ones
What's the purpose of a set of grades? That seems like a pretty odd use-case.
What's the purpose of a set of grades? That seems like a pretty odd use-case.
It doesn't make sense for grades, but I was planning to think of a better example, eventually. I just started Typing A,B,C and thought "maybe notes of a chord", but didn't want to add sharps/flats, so I put grades.
In reality, I would probably use something like this for a tagging system, since tag order doesn't matter and there's no need for multiple instances of the same tag
A set of chords would be strange as well. A set of notes though would make some sense in a program that determines a chord. For brevity just A-G would suffice here.
It ultimately doesn't matter but I always prefer when these examples make some sense.
Went with the DnD 5e damage types, and chose a weapon with multiple types of damage