Basically what I want to do is setup a good event system so that all of my objects/classes can respond to various types of events (built-in an "additional" ones).
In addition to Irrlicht's built-in events, I want to look for "Double-clicks" and "Mouse-hovers". Now, I have the code for both of these events working, but they are currently located outside the main program's OnEvent() section.
Let's say for example that I want to make a small application that has lots of boxes that can be selected, double-clicked and should respond to the mouse-hover. Each box is a Class (say, CBox) that has the Node's pointer and other useful information including WHAT should happen when particular events occur.
Now if in my main application's OnEvent method, I call each of the CBox's OnEvent() method: how can I also pass on the information such as SelectedNode (gathered from getSceneNodeFromRayBB), and bDoubleClick (whether or not a double-click has happened), etc..
I know I could do something like:
Code: Select all
CBox->OnEvent(event, SelectedNode, bDoubleClick, ...);Can anyone please suggest some good coding standards to implement this properly. Many thanks.