I trying to building a game engine using c++ and SFML library. I am working on collision detection. I created a base class Collider that has a pure virtual function collideWith(Collider* other). I would like to inherit that into BoxCollider and CircleCollider, where I would like to overload the collideWith(Collider* other) to distinguish different types of colliders and respond accordingly. I am doing that to be able to create a std::list<Collider*> in the game class and use polymorphism and overloading to check for proper collision. The only way I was able to accomplish this was to override the collideWith(Collider* other) function in derived classes, use dynamic_cast for type checking and forwarding the cast argument to its proper method. I have two questions:
1. Would this be considered good practice? Say if I have a hundred of Collider pointers and casting them dynamically every game cycle?
2. Is there a better way to accomplish this?