-
Message comparison
I am writing a message system for my game engine.
I am writing a message director so object types can register messages as to ease the time the handlers are in actions.
I do not want to run a for loop on a dword array to check if a certain unit type is to recieve this message for every message for every unit type.
Is there a quicker way?
Perhaps OR messages and some bit comparisons...
This I do not know how to do.
-
Re: Message comparison
You should make a multimap (that would be a Dictionary abstract data type that can hold more than one value per key, implemented by std::multimap and the hash_multimap that comes as an extension with many compilers) that maps from the message ID to the unit types that are to receive the message.
-
Re: Message comparison
Sounds rather complex to write myself.
I suppose I could use the STD for this
I want to research std::multimap?
I know what hash's are but I have no methods of generating them. You say the hash_multimap is a compiler extension? VC7 have it?
Edit: Google provides crap for std::multimap tutorials, articles, etc.
http://192.121.234.229/manualer/prog...p-members.html
That helps once I get it working, but I don't even know where to start.