INNER CODE UNIT · Rust
build_system_sets
rust-gamedev/rust-game-ports · rusty_roguelike-bevy/src/systems/mod.rs:16
pub fn build_system_sets(app: &mut App) {
use GameStage::*;
use TurnState::*;
// As of v0.7, it's not possible to flush commands on-demand, like Legion does; Bevy flushes the
// commands only at the end of each stage. Although this approach is not so immediate, it still
// allows a cleanly structured model; we isolate each block of systems that performs a change, and
// put it inside a system set.
//
// It's techically possible to write multiple schedulers like Legion, and update them on the fly
// (since we're in charge of the main loop), however, it's more complicated than Legion, and additionally,
// it doesn't offer any concrete advantage over system sets.
//
// A very serious limitation in the current Bevy version is that states/stages are essentially unusable
// together (and also in other conditions, e.g. with FixedTimeStep), therefore, it's necessary to
// use the crate `iyes_loopless`, which implements this functionality without limitations.
//
// The states modeled in the port are the same three as the source project, although technically,