Skip to content

Commit ef68781

Browse files
committed
Resolve comments
1 parent b3872b1 commit ef68781

File tree

2 files changed

+18
-14
lines changed

2 files changed

+18
-14
lines changed

crates/bevy_ecs/src/schedule_v3/config.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ pub trait IntoSystemSetConfig: sealed::IntoSystemSetConfig {
8888
/// Add to the provided `set`.
8989
#[track_caller]
9090
fn in_set(self, set: impl SystemSet) -> SystemSetConfig;
91-
/// Add to the provided "base" `set`.
91+
/// Add to the provided "base" `set`. For more information on base sets, see [`SystemSet::is_base`].
9292
#[track_caller]
9393
fn in_base_set(self, set: impl SystemSet) -> SystemSetConfig;
9494
/// Add this set to the schedules's default base set.
@@ -230,11 +230,11 @@ impl IntoSystemSetConfig for SystemSetConfig {
230230
fn in_base_set(mut self, set: impl SystemSet) -> Self {
231231
assert!(
232232
!set.is_system_type(),
233-
"adding arbitrary systems to a system type set is not allowed"
233+
"System type sets cannot be base sets."
234234
);
235235
assert!(
236236
set.is_base(),
237-
"Normal sets cannot be added to system sets using 'in_base_set'. Use 'in_set' instead."
237+
"Sets cannot be added to normal sets using 'in_base_set'. Use 'in_set' instead."
238238
);
239239
assert!(
240240
!self.set.is_base(),
@@ -296,7 +296,7 @@ pub trait IntoSystemConfig<Params>: sealed::IntoSystemConfig<Params> {
296296
/// Add to `set` membership.
297297
#[track_caller]
298298
fn in_set(self, set: impl SystemSet) -> SystemConfig;
299-
/// Add to the "base" `set` membership.
299+
/// Add to the provided "base" `set`. For more information on base sets, see [`SystemSet::is_base`].
300300
#[track_caller]
301301
fn in_base_set(self, set: impl SystemSet) -> SystemConfig;
302302
/// Don't add this system to the schedules's default set.
@@ -434,11 +434,11 @@ impl IntoSystemConfig<()> for SystemConfig {
434434
fn in_base_set(mut self, set: impl SystemSet) -> Self {
435435
assert!(
436436
!set.is_system_type(),
437-
"adding arbitrary systems to a system type set is not allowed"
437+
"System type sets cannot be base sets."
438438
);
439439
assert!(
440440
set.is_base(),
441-
"Systems cannot be added to normal system sets using 'in_base_set'. Use 'in_set' instead."
441+
"Systems cannot be added to normal sets using 'in_base_set'. Use 'in_set' instead."
442442
);
443443
self.graph_info.set_base_set(Box::new(set));
444444
self
@@ -533,7 +533,7 @@ where
533533
self.into_configs().in_set(set)
534534
}
535535

536-
/// Add these systems to the provided "base" `set`.
536+
/// Add these systems to the provided "base" `set`. For more information on base sets, see [`SystemSet::is_base`].
537537
#[track_caller]
538538
fn in_base_set(self, set: impl SystemSet) -> SystemConfigs {
539539
self.into_configs().in_base_set(set)
@@ -600,11 +600,11 @@ impl IntoSystemConfigs<()> for SystemConfigs {
600600
fn in_base_set(mut self, set: impl SystemSet) -> Self {
601601
assert!(
602602
!set.is_system_type(),
603-
"adding arbitrary systems to a system type set is not allowed"
603+
"System type sets cannot be base sets."
604604
);
605605
assert!(
606606
set.is_base(),
607-
"Systems cannot be added to normal system sets using 'in_base_set'. Use 'in_set' instead."
607+
"Systems cannot be added to normal sets using 'in_base_set'. Use 'in_set' instead."
608608
);
609609
for config in &mut self.systems {
610610
config.graph_info.set_base_set(set.dyn_clone());
@@ -686,7 +686,7 @@ where
686686
self.into_configs().in_set(set)
687687
}
688688

689-
/// Add these system sets to the provided "base" `set`.
689+
/// Add these system sets to the provided "base" `set`. For more information on base sets, see [`SystemSet::is_base`].
690690
#[track_caller]
691691
fn in_base_set(self, set: impl SystemSet) -> SystemSetConfigs {
692692
self.into_configs().in_base_set(set)
@@ -752,11 +752,11 @@ impl IntoSystemSetConfigs for SystemSetConfigs {
752752
fn in_base_set(mut self, set: impl SystemSet) -> Self {
753753
assert!(
754754
!set.is_system_type(),
755-
"adding arbitrary systems to a system type set is not allowed"
755+
"System type sets cannot be base sets."
756756
);
757757
assert!(
758758
set.is_base(),
759-
"Sets cannot be added to normal system sets using 'in_base_set'. Use 'in_set' instead."
759+
"Sets cannot be added to normal sets using 'in_base_set'. Use 'in_set' instead."
760760
);
761761
for config in &mut self.sets {
762762
assert!(

crates/bevy_ecs/src/schedule_v3/set.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,12 @@ pub trait SystemSet: DynHash + Debug + Send + Sync + 'static {
2323
false
2424
}
2525

26-
/// Returns `true` if this set is a "base system set", which systems
27-
/// can only belong to one of.
26+
/// Returns `true` if this set is a "base system set". Systems
27+
/// can only belong to one base set at a time. Systems and Sets
28+
/// can only be added to base sets using specialized `in_base_set`
29+
/// APIs. This enables "mutually exclusive" behaviors. It also
30+
/// enables schedules to have a "default base set", which can be used
31+
/// to apply default configuration to systems.
2832
fn is_base(&self) -> bool {
2933
false
3034
}

0 commit comments

Comments
 (0)