Question d’entretien chez GSC Game

How to implement type checking without dynamic_cast and strings comparison when developing classes hierarchy?

Réponse à la question d'entretien

Utilisateur anonyme

1 nov. 2012

provide pure virtual methods (in the very base class) like "cast_to_game_object", "cast_to_npc" and return "this" in implementations of these methods in appropriate derived classes