Exclusive systems can now be used for one-shot systems (#11560)
Joy notified me that exclusive systems should now work (they may have always worked, I don't know), so here's a quick change to the documentation.
This commit is contained in:
parent
7da144bc3d
commit
a955d65ffa
@ -145,7 +145,6 @@ impl World {
|
|||||||
/// # Limitations
|
/// # Limitations
|
||||||
///
|
///
|
||||||
/// - Stored systems cannot be recursive, they cannot call themselves through [`Commands::run_system`](crate::system::Commands).
|
/// - Stored systems cannot be recursive, they cannot call themselves through [`Commands::run_system`](crate::system::Commands).
|
||||||
/// - Exclusive systems cannot be used.
|
|
||||||
///
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
@ -239,7 +238,6 @@ impl World {
|
|||||||
/// # Limitations
|
/// # Limitations
|
||||||
///
|
///
|
||||||
/// - Stored systems cannot be recursive, they cannot call themselves through [`Commands::run_system`](crate::system::Commands).
|
/// - Stored systems cannot be recursive, they cannot call themselves through [`Commands::run_system`](crate::system::Commands).
|
||||||
/// - Exclusive systems cannot be used.
|
|
||||||
///
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
@ -505,6 +503,17 @@ mod tests {
|
|||||||
assert_eq!(output, NonCopy(3));
|
assert_eq!(output, NonCopy(3));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn exclusive_system() {
|
||||||
|
let mut world = World::new();
|
||||||
|
let exclusive_system_id = world.register_system(|world: &mut World| {
|
||||||
|
world.spawn_empty();
|
||||||
|
});
|
||||||
|
let entity_count = world.entities.len();
|
||||||
|
let _ = world.run_system(exclusive_system_id);
|
||||||
|
assert_eq!(world.entities.len(), entity_count + 1);
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn nested_systems() {
|
fn nested_systems() {
|
||||||
use crate::system::SystemId;
|
use crate::system::SystemId;
|
||||||
|
Loading…
Reference in New Issue
Block a user