This is a big one. For me, at least.
I have several different drawing methods that each perform similarly, to the point that the code is nearly redundant. The problem is that they have enough differences that combining them into one big honking draw method would either require lots of counter-productive if/else statements or a bajillion parameters. I tried the bajillion parameters way and stuff broke and I chickened out and restored everything from backups.
So my questions are:
1. Is combining the methods into one even necessary/advantageous? Will it be faster to keep them separate, especially if they're called simultaneously?
2. I tried using a table to store the values of the parameters of each object that could be drawn so that each method call would look like
draw(table)
instead of
draw(x, y, rotation, scale, label, list, index, ...)
That didn't work. What is the proper way to pass a table in as a series of parameters?
3. Is there a better way to do this that I just completely missed the bus on? If so, tell me, oh wise one.