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).
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).