WizardWarsIO / wiz-server

WizardWars.IO Python Server
http://WizardWars.IO
11 stars 1 forks source link

Message handling should only traverse registered subscribers #44

Open quantumproducer opened 6 years ago

quantumproducer commented 6 years ago

Currently, entities pass all messages to all components. This is odd and inefficient. An entity, when adding a component, should register that component with a dictionary of mapping topics to a list of subscribers. Upon receiving that topic as a message, it should dispatch it only to its components that subscribed (which in turn could be subscribed only for their sub components).