Original Post
Those words scare me but that is what someone mentioned I need to use.
EntityManager
-------------
vector(Entity*) entitieList;
void Send( int ENTID, enum MESSAGE, void* param1, void* param2 );
Entity
------
virtual Recieve( int ENTID, enum MESSAGE, void* param1, void* param2 );
Every object in the game is registered in the entity manager, and every object is derived from an Entity. When one object wants to send a message to another, it calls EntityManager::Send( id, message, param1, param2 ), The entity manager calls recieve on the entity and hat object it is calling needs to catch the message(or discard it).
This is all fine an dandy but I'm using void* and c-style casts all over the place. I'd like to move this to template parameters and so every recieve function for each object in the game could have their own proper types. Someone said I need to use double despatching and the visitors pattern but left it at that and I have no idea where to start.
[edited by - ph33r on June 8, 2004 2:41:40 PM]