musademir
❔ Generic class to fire on data change according to data type
Hi everyone. I am tring to implement generic class that holds generic type of data class. And I will store them in a dictionary and fire their function according to type of data class. Please check code for more detail.
Here is my interfaces
Classes that inherits them
Then I want to add them to a dictionary and call according to their data type.
Eventhough MyData and MyData2 inherits IMyDataInterface, it gives me not assignable to parameter type error.
And here is the purpose of that implementation. It should trigger related listener's OnDataChange function
Can you please guide me about how should I implement that, or what is wrong with the code?
67 replies