I have a method that accepts a Hashtable (yes, I know, it's deprecated ..) as an argument:
public static LuaTable HashtableToLuatable(Hashtable t, int depth = 1)
This is working correctly.
Now I would like to accept ArrayList as the first parameter, so you can let 't' have a value of both Hashtable and ArrayList. Currently, I have copied the method twice, for example:
public static LuaTable ArraylistToLuatable(ArrayList t, int depth = 1)
The rest is exactly the same.
I think there is a way to merge this.
source
share