I find myself needing to provide generic functions that have specific implementations for specific objects. So I tried to use wrapper classes like I’m used to in Android programming: a base class that specifies the function signature, and instantiating a specific implementation for what I need at the moment. As luck would have it, my first go at this requires iterating through an array of generic functions.
I thought either an Array of Object References or Class References would allow me to do this; the problem is, while I can apply the desired Class Reference at design time, this does not allow me to actually call the function in the class; if I instead use Object References, I can call the functions, but I can’t figure out how to provide an instance.
So I thought I would combine the two: expose the Array of Class References to the designer, then instantiate an Array of Object References from that Array in Begin Play, but I am getting the error: “Cannot construct objects of type ‘MyType_C’ in Construct Object from Class” when I try.
What could be causing this error; or ideally, what is the best way to handle my need to iterate over a list of glorified function pointers?