amethyst / shred

Shared resource dispatcher

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Separate RunNow and Setup

Lotrotk opened this issue · comments

Hi,

After experimenting a bith with Amethyst, I started wondering why the System trait is responsible for both setup and run (+dispose). I programmed my setup to fetch a resource, then store it as a struct member, but I am forced to wrap it inside an Option and unwrap it upon each call of run.
Ideally I would have the System trait not having the run or dispose method, but move those to another trait. The setup would then consume the system and return an instance of this new trait.
In this way there will be no more need for me to wrap the resource during setup.

I tried to tinker with shred's code a bit myself, and it becomes clear that this is not a minor code change. Obviously it would break the API as well. So my question is : will this concept be in a future release ?