|
-
Jul 14th, 2005, 09:17 PM
#1
Thread Starter
PowerPoster
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.
"From what was there, and was meant to be, but not of that was faded away." - - Steve Damm
"The polar opposite of nothingness is existance. When existance calls apon nothingness it shall return to nothingness." - - Steve Damm
"When you do things right, people won't be sure if you did anything at all." - - God from Futurama
-
Jul 15th, 2005, 07:10 AM
#2
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.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Jul 15th, 2005, 11:19 AM
#3
Thread Starter
PowerPoster
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.
Last edited by Halsafar; Jul 15th, 2005 at 11:32 AM.
"From what was there, and was meant to be, but not of that was faded away." - - Steve Damm
"The polar opposite of nothingness is existance. When existance calls apon nothingness it shall return to nothingness." - - Steve Damm
"When you do things right, people won't be sure if you did anything at all." - - God from Futurama
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|