Quillraven / Fleks

Fast, lightweight, multi-platform entity component system in Kotlin
MIT License
180 stars 20 forks source link

System lifecycle #148

Closed RefuX closed 4 months ago

RefuX commented 4 months ago

When a system is removed from the world, we should dispose the resources it is using. If a disposed system is readded to the world it will have to be smart enough to re-create resources or error.

Quillraven commented 4 months ago

We also have an onInit function on a system. I am wondering if we should call that when a system gets added?

Currently it gets called after the world configuration is done.

RefuX commented 4 months ago

We also have an onInit function on a system. I am wondering if we should call that when a system gets added?

Currently it gets called after the world configuration is done.

Fantastic point, I was wondering about a compliment to onDispose.

Quillraven commented 4 months ago

Should be available in SNAPSHOT in a few minutes. Thanks for the contribution!