amethyst / amethyst/specs

Best practice for borrowed resources in systems?

Offen
#757 4 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
question
Vorherrschende Sprache
Rust
Sterne
2.6k
Forks
215
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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?

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.