Quote:
Originally Posted by MysteryX
Switch or if's is what I used to do, but with all the new data formats, it's getting very messy.
|
I fail to see how it's less messy than your solution which is an over-engineered mess. The switch statement in C is entirely created to do what you want which is to map some action to an integeral value.
This isn't Java where you need an abstract factory factory builder simply to create a one-off utility function.