amethyst / amethyst/specs

Best practice for borrowed resources in systems?

Đang mở
#757 4 bình luận 0 reaction 0 người được giao Xem trên GitHub
question
Ngôn ngữ chính
Rust
Star
2.6k
Fork
215
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

I'm halfway through the [Roguelike tutorial](https://bfnightly.bracketproductions.com/rustbook/) and I would like to move my render logic into a `System` and use a `Dispatcher` instead of manually running systems. In this case `bracket-lib` has a `tick` where you mutably borrow a `BTerm` instance, but it feels like this is a common pattern where some kind of context is mutably borrowed.

What's the best practice here? Should we just build a dispatcher per tick and pass the context in the system struct?

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.