Skip to content

Commit

Permalink
Resolve comments
Browse files Browse the repository at this point in the history
  • Loading branch information
cart committed Feb 6, 2023
1 parent b3872b1 commit ef68781
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 14 deletions.
24 changes: 12 additions & 12 deletions crates/bevy_ecs/src/schedule_v3/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ pub trait IntoSystemSetConfig: sealed::IntoSystemSetConfig {
/// Add to the provided `set`.
#[track_caller]
fn in_set(self, set: impl SystemSet) -> SystemSetConfig;
/// Add to the provided "base" `set`.
/// Add to the provided "base" `set`. For more information on base sets, see [`SystemSet::is_base`].
#[track_caller]
fn in_base_set(self, set: impl SystemSet) -> SystemSetConfig;
/// Add this set to the schedules's default base set.
Expand Down Expand Up @@ -230,11 +230,11 @@ impl IntoSystemSetConfig for SystemSetConfig {
fn in_base_set(mut self, set: impl SystemSet) -> Self {
assert!(
!set.is_system_type(),
"adding arbitrary systems to a system type set is not allowed"
"System type sets cannot be base sets."
);
assert!(
set.is_base(),
"Normal sets cannot be added to system sets using 'in_base_set'. Use 'in_set' instead."
"Sets cannot be added to normal sets using 'in_base_set'. Use 'in_set' instead."
);
assert!(
!self.set.is_base(),
Expand Down Expand Up @@ -296,7 +296,7 @@ pub trait IntoSystemConfig<Params>: sealed::IntoSystemConfig<Params> {
/// Add to `set` membership.
#[track_caller]
fn in_set(self, set: impl SystemSet) -> SystemConfig;
/// Add to the "base" `set` membership.
/// Add to the provided "base" `set`. For more information on base sets, see [`SystemSet::is_base`].
#[track_caller]
fn in_base_set(self, set: impl SystemSet) -> SystemConfig;
/// Don't add this system to the schedules's default set.
Expand Down Expand Up @@ -434,11 +434,11 @@ impl IntoSystemConfig<()> for SystemConfig {
fn in_base_set(mut self, set: impl SystemSet) -> Self {
assert!(
!set.is_system_type(),
"adding arbitrary systems to a system type set is not allowed"
"System type sets cannot be base sets."
);
assert!(
set.is_base(),
"Systems cannot be added to normal system sets using 'in_base_set'. Use 'in_set' instead."
"Systems cannot be added to normal sets using 'in_base_set'. Use 'in_set' instead."
);
self.graph_info.set_base_set(Box::new(set));
self
Expand Down Expand Up @@ -533,7 +533,7 @@ where
self.into_configs().in_set(set)
}

/// Add these systems to the provided "base" `set`.
/// Add these systems to the provided "base" `set`. For more information on base sets, see [`SystemSet::is_base`].
#[track_caller]
fn in_base_set(self, set: impl SystemSet) -> SystemConfigs {
self.into_configs().in_base_set(set)
Expand Down Expand Up @@ -600,11 +600,11 @@ impl IntoSystemConfigs<()> for SystemConfigs {
fn in_base_set(mut self, set: impl SystemSet) -> Self {
assert!(
!set.is_system_type(),
"adding arbitrary systems to a system type set is not allowed"
"System type sets cannot be base sets."
);
assert!(
set.is_base(),
"Systems cannot be added to normal system sets using 'in_base_set'. Use 'in_set' instead."
"Systems cannot be added to normal sets using 'in_base_set'. Use 'in_set' instead."
);
for config in &mut self.systems {
config.graph_info.set_base_set(set.dyn_clone());
Expand Down Expand Up @@ -686,7 +686,7 @@ where
self.into_configs().in_set(set)
}

/// Add these system sets to the provided "base" `set`.
/// Add these system sets to the provided "base" `set`. For more information on base sets, see [`SystemSet::is_base`].
#[track_caller]
fn in_base_set(self, set: impl SystemSet) -> SystemSetConfigs {
self.into_configs().in_base_set(set)
Expand Down Expand Up @@ -752,11 +752,11 @@ impl IntoSystemSetConfigs for SystemSetConfigs {
fn in_base_set(mut self, set: impl SystemSet) -> Self {
assert!(
!set.is_system_type(),
"adding arbitrary systems to a system type set is not allowed"
"System type sets cannot be base sets."
);
assert!(
set.is_base(),
"Sets cannot be added to normal system sets using 'in_base_set'. Use 'in_set' instead."
"Sets cannot be added to normal sets using 'in_base_set'. Use 'in_set' instead."
);
for config in &mut self.sets {
assert!(
Expand Down
8 changes: 6 additions & 2 deletions crates/bevy_ecs/src/schedule_v3/set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,12 @@ pub trait SystemSet: DynHash + Debug + Send + Sync + 'static {
false
}

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

0 comments on commit ef68781

Please sign in to comment.