So I'm working on a personal project (trying to get better at c++), and I'm trying to get this working:
I have an ABC class A with a pure virtual function interactWith(A* target);
I then have two derived classes, class B and class C.
However, class B must interactWith class C differently than with another class B
I found one way of doing this with an if/else and a virtual getType() in the ABC, but I was curious if there was a more elegant way or if I'm just doing something very stupid, and if I am doing something stupid (which is very possible), where would I begin searching for a better solution (i.e. a more appropriate design pattern)
Please note: I'm not using boost, and I'd rather avoid it for now, and start learning it when I'm actually good at programming
Any help you could provide would be welcome. Please and thankyou
Something I should note: classes B and C will (should) only be visible via an A*