Data Structure of Pointers to Interface Objects
I have an interface that I've created for my creeps:
Let's say that in one of my other objects I want to store a map. The key will be the creep type (represented by an int). The value will be a TArray of the available creeps of that type. Something like this:
So if I have 1 creep of type 1 and 2 creeps of type two my structure should look like this:
Now, I have a pointer to an IICreepBasic that I want to insert as a type 1 so that I get:
[PointerToCreepOne, PointerToCreepFour] ,
I write a function:
Unfortunately I get this error:
Error C2664: 'RegisterCreep(IICreepBasic *)': cannot convert arguement 1 from TScriptInterface opencarrot IICreepBasic closecarrot ' to 'IICreepBasic *'
I'm not sure where the TScriptInterface is coming into things. Am I missing something obvious?
I don't think the issue is the 2D arrays.
Your TMap should work fine as long as you are actually creating an empty array the first time you add a new KEY. So, actually, you should use
Follow this question
Once you sign in you will be able to subscribe for any updates here