Strategy API: access to FaceTable
Allow strategies to access FaceTable, including:
- enumerate Faces that satisfy a certain predicate
- subscribe to onAdd and onRemove events
Updated by Alex Afanasyev over 5 years ago
I don't understand why strategy needs to fire events for "create" and "remove" faces. I can understand that strategy may get notification about those events, but not invoke them. Strategy is not supposed to create faces and even if it creates, there should be separate non-strategy related interface for that.
Updated by Junxiao Shi over 5 years ago
- Description updated (diff)
Strategies can subscribe to onAdd and onRemove events, which means they can get notifications.
The semantics of
EventEmitter is that only the class in which
EventEmitter is declared should trigger the event, and other classes can only subscribe to the event.
This rule is currently a convention; it cannot be enforced in code without changing declaration format.
This problem has nothing to do with #2272.