quote:Original post by antareus
I am in the middle of writing an article for GD on this subject actually. Look for it shortly.
woa...goodies''r''us
will look for it
quote:Original post by antareus
I am in the middle of writing an article for GD on this subject actually. Look for it shortly.
quote:Original post by Anonymous Poster
I just used a message singleton and each class would have a copy of the same msg handler. The classes/objects would then register with the msg handler in their initialisation giving it a uniqie ID. The Msg handler then created a queue for each registered class to hold its messages.
It was up to the classes to check for mail in by calling the msngr handler, which just returned the message at the front of the queue.
In addition to the queue, each class could register a function/callback to be called by the msgr for really important messages, sort of like an interrupt. So normal priority messages would be placed in the queue to be checked at leasiure, while others such as QUIT etc. were initiated automatically.
Don''t know if it''s a good way to do it or not but it worked quite well for our game.