amethyst / amethyst/shred

Separate RunNow and Setup

未关闭
#199 0 条评论 2 个 reaction 已指派 0 人 在 GitHub 查看
discussion enhancement question
主要语言
Rust
星标
250
派生
65
PR 合并指标
30 天内没有已合并 PR

描述

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 ?

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。