pub trait MultiDispatchController<'a>: Send {
    type SystemData: SystemData<'a>;

    fn plan(&mut self, data: Self::SystemData) -> usize;
Expand description

The controlling parts of simplified BatchControllers for running a batch fixed number of times.

If one needs to implement a BatchController that first examines some data and decides upfront how many times a set of sub-systems are to be dispatched, this can help with the implementation. This is less flexible (it can’t examine things in-between iterations of dispatching, for example), but is often enough and more convenient as it avoids manual fetching of the resources.

A common example is pausing a game ‒ based on some resource, the game physics systems are run either 0 times or once.

A bigger example can be found in the multi_batch_dispatching.

To be useful, pass the controller to the constructor of MultiDispatcher and register with add_batch.

Required Associated Types

What data it needs to decide on how many times the subsystems should be run.

This may overlap with system data used by the subsystems, but doesn’t have to contain them.

Required Methods

Performs the decision.

Returns the number of times the batch should be run and the MultiDispatcher will handle the actual execution.