I'm coding a game with cocosharp in C# for iOS. I want to have an object that will store different objects from different classes and through this object I want call public methods from this objects. The problem is that active object can be from three different classes with public methods with same name. My vision is like this:
//object for store active object
General_class active_object = new General_class();
//my_game_object is active layer now
active_object = my_game_object;
// pop_in() is method that has same name in different classes
active_object.pop_in();
My question is if is something like this even possible and what should be the General_class class.
Thank you
edit
I forgot to mention that my_game_object inherits from CCLayer class from cocossharp library.
edit 2
This thread solves my problem.