ecsyjs / ecsy

Entity Component System for javascript
https://ecsyjs.github.io/ecsy/
MIT License
1.11k stars 115 forks source link

typescript: parametrize World and System over Entity #248

Closed DavidPeicho closed 4 years ago

DavidPeicho commented 4 years ago

Hi,

This is a super simple PR introducing:

Why?

When creating a custom entity, all typings are lost (in favor of the base Entity class) in createEntity and inside inherited systems. It can make the framework a bit unpleasant to use, either because you need to cast first to unknown, or because you need to create an intermediate system class.

robertlong commented 4 years ago

LGTM, thank you! I'll update ecsy-three to use this as well.