I am confused by C# right now.
I have a bunch of classes, say A, B, and C, which all derive from class "Parent". I have a function which takes an argument of type Parent, and depending on which child class the object it is called with is, I want it to call a different method.
Currently, I am thinking using a dictionary mapping types to delegates, but that seems silly, though it is all I can come up with at the moment.
The problem is that when I am in the function, I only know that it is of type Parent, and I can use GetType to get which child class I have, which would allow the dictionary. Otherwise I would probably use function overloading.
Really typecasting seems like the best method, allowing me to use function overloading, which would be much less verbose, but I don't know how I could do it or if it would work at all.
Any reccomendations?