You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 ?
The text was updated successfully, but these errors were encountered:
Hi,
After experimenting a bith with Amethyst, I started wondering why the
System
trait is responsible for bothsetup
andrun
(+dispose
). I programmed my setup to fetch a resource, then store it as a struct member, but I am forced to wrap it inside anOption
and unwrap it upon each call ofrun
.Ideally I would have the
System
trait not having therun
ordispose
method, but move those to another trait. Thesetup
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 ?
The text was updated successfully, but these errors were encountered: