Skip to content

Separate RunNow and Setup #199

@Lotrotk

Description

@Lotrotk

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 ?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions