rhelgeby / smprojectbase

Automatically exported from code.google.com/p/smprojectbase
0 stars 0 forks source link

Layered event manager #57

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
The current event manager is simple and will simply forward any events that 
modules have hooked. For the game mode ideas in Zombie:Reloaded it will need to 
filter events based on certain rules.

It must support multiple layers of filters, and the event must past all filters 
to be forwarded to a module. The design should make it possible to block/allow 
certain events to certain modules.

Idea on how to implement this:

Define a filter matrix with all events on one axis and modules on the other 
axis. Put the filters in an array so there can be multiple filters.

The base will have its own filter matrix where it control raw events to 
modules. Like when a module is disabled, the base's filter will disable events 
on that module.

The plugin that use the base will create, read and modify its own filters 
through a filter API in the base.

In the base's event forward function it will read each filter and look up 
module and event on each filter. If everyone is allowed the event is fired, 
otherwise it's blocked.

Original issue reported on code.google.com by richard.helgeby@gmail.com on 10 Jun 2010 at 5:53

GoogleCodeExporter commented 9 years ago
Note that the base will only allow/disallow events. Event rules have to be 
managed by the plugin itself by modifying the filter(s).

Original comment by richard.helgeby@gmail.com on 10 Jun 2010 at 5:54

GoogleCodeExporter commented 9 years ago
Sounds like a whole lotta work when you can just put if statements in the 
event..?

Is this supposed to be a performance boost?

Original comment by andrewbo...@gmail.com on 26 Mar 2011 at 7:13

GoogleCodeExporter commented 9 years ago
I don't remember why we needed this, though it sounds useful.

Put this on hold for now (stay at status "new").

Original comment by richard.helgeby@gmail.com on 27 Apr 2011 at 1:27