Skip to content

Commit

Permalink
reword docs
Browse files Browse the repository at this point in the history
  • Loading branch information
hymm committed Sep 22, 2023
1 parent e93b97a commit a2db340
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
10 changes: 6 additions & 4 deletions crates/bevy_ecs/src/schedule/schedule.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1733,17 +1733,17 @@ impl ScheduleBuildSettings {
}
}

/// list of [`ComponentId`]'s to ignore when reporting ambiguity conflicts between systems
/// List of [`ComponentId`]s to ignore when reporting system order ambiguity conflicts
#[derive(Resource, Default, Clone, Debug)]
pub struct IgnoredSchedulingAmbiguities(BTreeSet<ComponentId>);

impl IgnoredSchedulingAmbiguities {
/// Ignore ambiguities between systems in [`Component`] T.
/// Ignore system order ambiguities caused by conflicts on [`Component`]s of type `T`.
pub fn allow_ambiguous_component<T: Component>(&mut self, world: &mut World) {
self.0.insert(world.init_component::<T>());
}

/// Ignore ambiguities between systems in [`Resource`] T.
/// Ignore system order ambiguities caused by conflicts on [`Resource`]s of type `T`.
pub fn allow_ambiguous_resource<T: Resource>(&mut self, world: &mut World) {
self.0.insert(world.components.init_resource::<T>());
}
Expand All @@ -1758,7 +1758,9 @@ impl IgnoredSchedulingAmbiguities {
/// May panic or retrieve incorrect names if [`Components`] is not from the same
/// world
pub fn print_names(&self, components: &Components) {
let mut message = "Ambiguities of the following types are ignored:\n".to_string();
let mut message =
"System order ambiguities caused by conflicts on the following types are ignored:\n"
.to_string();
for id in self.iter() {
writeln!(message, "{}", components.get_name(*id).unwrap()).unwrap();
}
Expand Down
4 changes: 2 additions & 2 deletions crates/bevy_ecs/src/world/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2088,7 +2088,7 @@ impl World {
self.schedule_scope(label, |world, sched| sched.run(world));
}

/// Ignore ambiguities between systems in [`Component`] T.
/// Ignore system order ambiguities caused by conflicts on [`Component`]s of type `T`.
pub fn allow_ambiguous_component<T: Component>(&mut self) {
let mut ignored_ambiguities = self
.remove_resource::<IgnoredSchedulingAmbiguities>()
Expand All @@ -2097,7 +2097,7 @@ impl World {
self.insert_resource(ignored_ambiguities);
}

/// Ignore ambiguities between systems in [`Resource`] T.
/// Ignore system order ambiguities caused by conflicts on [`Resource`]s of type `T`.
pub fn allow_ambiguous_resource<T: Resource>(&mut self) {
let mut ignored_ambiguities = self
.remove_resource::<IgnoredSchedulingAmbiguities>()
Expand Down

0 comments on commit a2db340

Please sign in to comment.