GGAlanSmithee / Entities

efficient and easy-to-use Entity-Component System in JavaScript
http://ggalansmithee.github.io/Entities/
MIT License
4 stars 1 forks source link

add more sophisiticated trigger functionality #93

Closed GGAlanSmithee closed 6 years ago

GGAlanSmithee commented 6 years ago

atm, {eventHandler/entityManager}.{trigger/triggerDelayed}, triggers all registered events. This is a bit naive and should be extended to actually be useful.

Proposal:

  1. trigger / triggerDelayed takes a optional key parameter 1.1 if key is null, trigger all events (as currently implemented) 1,2 if key is not null and only triggers corresponding event
GGAlanSmithee commented 6 years ago

The above is actually not true.

The implicit nature of those methods and their arguments is problematic though. In e26ae63ccea90d40f124a09cf9d6409acb629422 this has now been changed to be more explicit, i.e. entityManager.trigger(event: string, opts?: object).

Will be merged to dev and eventually to master. closing.