Pergunta de entrevista da empresa GSC Game

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

Resposta da entrevista

Sigiloso

1 de nov. de 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