Call a function without specifying the class?

It sounds like you have an “evil-if over type” situation which usually calls for polymorphism as a first step in C++. My first recommendation without knowing the specifics of your project would be to create an Interface “Interactable” and have your objects inherit/implement it which would remove your all of your if statements.