Help with this casting issue
<p>I'm making a game where pretty much everything inherits from Entity. I also have an IRenderable interface for all entities that need to be rendered.</p>

<p>When loading the level, every entity that is IRenderable is placed in a vector of IRenderable* which is then passed to the renderer.</p>

<p>When I instance any Entity, I add it to a vector of Entity* .</p>

<p>What I'm wondering is what exactly should I do when this entity sends an ENTITY_DESTROYED message?</p>

<p>The problem is that I do not know if this Entity is IRenderable. I'd have to try and cast it for that and I'm not sure if casting is a good idea here.</p>

<p>What else could I do to avoid casting?</p>

<p>Thanks</p>

<p>Another point to note, even if I know it is IRenderable, the pointer might be different due to multiple inheritance.</p>
