I have a class called Effect that stores a collection of parameters that are unique to each Effect variant.
public enum EffectVariants { Slope, Noise, etc }
When I create a new instance, I have a factory that lets me return all the properites that Effect has
return effectType switch {
EffectVariants.Slope => new EffectData
{
effectType = EffectVariants.Slope,
parameters = new List<ParameterData>
{
new("Steepness", ParameterVariants.FloatField, new FloatValue { value = 1.0f })
},
{
new("Reverse", ParameterVariants.Toggle, new BoolValue { value = false })
},
},
The factory works, but it feels a bit cumbersome to work with, especially once I start populating it with many Effects. I'm debating whether I should possibly try doing it via json, or to replace the switch table with a dictionary. Perhaps theres an alternative way that could make this whole thing easier to do