diff --git a/benches/benches/bevy_ecs/components/archetype_updates.rs b/benches/benches/bevy_ecs/components/archetype_updates.rs index a7f8c2bc276a8..53cc22f6a1adb 100644 --- a/benches/benches/bevy_ecs/components/archetype_updates.rs +++ b/benches/benches/bevy_ecs/components/archetype_updates.rs @@ -1,4 +1,4 @@ -use bevy_ecs::{component::Component, schedule_v3::Schedule, world::World}; +use bevy_ecs::{component::Component, schedule::Schedule, world::World}; use criterion::{BenchmarkId, Criterion}; #[derive(Component)] diff --git a/benches/benches/bevy_ecs/scheduling/running_systems.rs b/benches/benches/bevy_ecs/scheduling/running_systems.rs index 27a22dce1b24b..9206bd285fcf4 100644 --- a/benches/benches/bevy_ecs/scheduling/running_systems.rs +++ b/benches/benches/bevy_ecs/scheduling/running_systems.rs @@ -1,4 +1,4 @@ -use bevy_ecs::{component::Component, schedule_v3::Schedule, system::Query, world::World}; +use bevy_ecs::{component::Component, schedule::Schedule, system::Query, world::World}; use criterion::Criterion; #[derive(Component)] diff --git a/crates/bevy_app/src/app.rs b/crates/bevy_app/src/app.rs index 2aaf527c36d17..8a67a2fc30cad 100644 --- a/crates/bevy_app/src/app.rs +++ b/crates/bevy_app/src/app.rs @@ -2,7 +2,7 @@ use crate::{CoreSchedule, CoreSet, Plugin, PluginGroup, StartupSet}; pub use bevy_derive::AppLabel; use bevy_ecs::{ prelude::*, - schedule_v3::{ + schedule::{ apply_state_transition, common_conditions::run_once as run_once_condition, run_enter_schedule, BoxedScheduleLabel, IntoSystemConfig, IntoSystemSetConfigs, ScheduleLabel, @@ -100,7 +100,7 @@ impl Debug for App { /// ```rust /// # use bevy_app::{App, AppLabel, SubApp, CoreSchedule}; /// # use bevy_ecs::prelude::*; -/// # use bevy_ecs::schedule_v3::ScheduleLabel; +/// # use bevy_ecs::schedule::ScheduleLabel; /// /// #[derive(Resource, Default)] /// struct Val(pub i32); @@ -315,7 +315,7 @@ impl App { /// These systems sets only run if the [`State`] resource matches their label. /// /// If you would like to control how other systems run based on the current state, - /// you can emulate this behavior using the [`state_equals`] [`Condition`](bevy_ecs::schedule_v3::Condition). + /// you can emulate this behavior using the [`state_equals`] [`Condition`](bevy_ecs::schedule::Condition). /// /// Note that you can also apply state transitions at other points in the schedule /// by adding the [`apply_state_transition`] system manually. @@ -526,7 +526,7 @@ impl App { /// /// ``` /// use bevy_app::App; - /// use bevy_ecs::schedule_v3::Schedules; + /// use bevy_ecs::schedule::Schedules; /// /// let app = App::empty() /// .init_resource::() @@ -549,7 +549,7 @@ impl App { } self.edit_schedule(CoreSchedule::Outer, |schedule| { - schedule.set_executor_kind(bevy_ecs::schedule_v3::ExecutorKind::SingleThreaded); + schedule.set_executor_kind(bevy_ecs::schedule::ExecutorKind::SingleThreaded); schedule.add_system(run_main_schedule); }); diff --git a/crates/bevy_app/src/lib.rs b/crates/bevy_app/src/lib.rs index 97df5ba5beade..5edd3f59abe95 100644 --- a/crates/bevy_app/src/lib.rs +++ b/crates/bevy_app/src/lib.rs @@ -28,7 +28,7 @@ pub mod prelude { } use bevy_ecs::{ - schedule_v3::{ + schedule::{ apply_system_buffers, IntoSystemConfig, IntoSystemSetConfig, IntoSystemSetConfigs, Schedule, ScheduleLabel, SystemSet, }, @@ -38,7 +38,7 @@ use bevy_ecs::{ /// The names of the default [`App`] schedules. /// -/// The corresponding [`Schedule`](bevy_ecs::schedule_v3::Schedule) objects are added by [`App::add_default_schedules`]. +/// The corresponding [`Schedule`](bevy_ecs::schedule::Schedule) objects are added by [`App::add_default_schedules`]. #[derive(ScheduleLabel, Clone, Debug, PartialEq, Eq, Hash)] pub enum CoreSchedule { /// The schedule that runs once when the app starts. @@ -74,7 +74,7 @@ impl CoreSchedule { /// Initializes a single threaded schedule for [`CoreSchedule::Outer`] that contains the [`outer_loop`](CoreSchedule::outer_loop) system. pub fn outer_schedule() -> Schedule { let mut schedule = Schedule::new(); - schedule.set_executor_kind(bevy_ecs::schedule_v3::ExecutorKind::SingleThreaded); + schedule.set_executor_kind(bevy_ecs::schedule::ExecutorKind::SingleThreaded); schedule.add_system(Self::outer_loop); schedule } @@ -84,7 +84,7 @@ impl CoreSchedule { /// /// These are ordered in the same order they are listed. /// -/// The corresponding [`SystemSets`](bevy_ecs::schedule_v3::SystemSet) are added by [`App::add_default_schedules`]. +/// The corresponding [`SystemSets`](bevy_ecs::schedule::SystemSet) are added by [`App::add_default_schedules`]. /// /// The `*Flush` sets are assigned to the copy of [`apply_system_buffers`] /// that runs immediately after the matching system set. @@ -100,7 +100,7 @@ pub enum CoreSet { PreUpdate, /// The copy of [`apply_system_buffers`] that runs immediately after `PreUpdate`. PreUpdateFlush, - /// Applies [`State`](bevy_ecs::schedule_v3::State) transitions + /// Applies [`State`](bevy_ecs::schedule::State) transitions StateTransitions, /// Runs systems that should only occur after a fixed period of time. /// @@ -160,7 +160,7 @@ impl CoreSet { /// The names of the default [`App`] startup sets, which live in [`CoreSchedule::Startup`]. /// -/// The corresponding [`SystemSets`](bevy_ecs::schedule_v3::SystemSet) are added by [`App::add_default_schedules`]. +/// The corresponding [`SystemSets`](bevy_ecs::schedule::SystemSet) are added by [`App::add_default_schedules`]. /// /// The `*Flush` sets are assigned to the copy of [`apply_system_buffers`] /// that runs immediately after the matching system set. diff --git a/crates/bevy_app/src/schedule_runner.rs b/crates/bevy_app/src/schedule_runner.rs index d03ca788e7799..28d39baffd2ff 100644 --- a/crates/bevy_app/src/schedule_runner.rs +++ b/crates/bevy_app/src/schedule_runner.rs @@ -11,14 +11,14 @@ use std::{cell::RefCell, rc::Rc}; #[cfg(target_arch = "wasm32")] use wasm_bindgen::{prelude::*, JsCast}; -/// Determines the method used to run an [`App`]'s [`Schedule`](bevy_ecs::schedule_v3::Schedule). +/// Determines the method used to run an [`App`]'s [`Schedule`](bevy_ecs::schedule::Schedule). /// /// It is used in the [`ScheduleRunnerSettings`]. #[derive(Copy, Clone, Debug)] pub enum RunMode { /// Indicates that the [`App`]'s schedule should run repeatedly. Loop { - /// The minimum [`Duration`] to wait after a [`Schedule`](bevy_ecs::schedule_v3::Schedule) + /// The minimum [`Duration`] to wait after a [`Schedule`](bevy_ecs::schedule::Schedule) /// has completed before repeating. A value of [`None`] will not wait. wait: Option, }, @@ -37,7 +37,7 @@ impl Default for RunMode { /// It gets added as a [`Resource`](bevy_ecs::system::Resource) inside of the [`ScheduleRunnerPlugin`]. #[derive(Copy, Clone, Default, Resource)] pub struct ScheduleRunnerSettings { - /// Determines whether the [`Schedule`](bevy_ecs::schedule_v3::Schedule) is run once or repeatedly. + /// Determines whether the [`Schedule`](bevy_ecs::schedule::Schedule) is run once or repeatedly. pub run_mode: RunMode, } @@ -59,7 +59,7 @@ impl ScheduleRunnerSettings { } } -/// Configures an [`App`] to run its [`Schedule`](bevy_ecs::schedule_v3::Schedule) according to a given +/// Configures an [`App`] to run its [`Schedule`](bevy_ecs::schedule::Schedule) according to a given /// [`RunMode`]. /// /// [`ScheduleRunnerPlugin`] is included in the @@ -67,7 +67,7 @@ impl ScheduleRunnerSettings { /// /// [`ScheduleRunnerPlugin`] is *not* included in the /// [`DefaultPlugins`](https://docs.rs/bevy/latest/bevy/struct.DefaultPlugins.html) plugin group -/// which assumes that the [`Schedule`](bevy_ecs::schedule_v3::Schedule) will be executed by other means: +/// which assumes that the [`Schedule`](bevy_ecs::schedule::Schedule) will be executed by other means: /// typically, the `winit` event loop /// (see [`WinitPlugin`](https://docs.rs/bevy/latest/bevy/winit/struct.WinitPlugin.html)) /// executes the schedule making [`ScheduleRunnerPlugin`] unnecessary. diff --git a/crates/bevy_diagnostic/src/lib.rs b/crates/bevy_diagnostic/src/lib.rs index 22a8141f398c7..9956002161112 100644 --- a/crates/bevy_diagnostic/src/lib.rs +++ b/crates/bevy_diagnostic/src/lib.rs @@ -5,7 +5,7 @@ mod log_diagnostics_plugin; mod system_information_diagnostics_plugin; use bevy_app::prelude::*; -use bevy_ecs::schedule_v3::IntoSystemConfig; +use bevy_ecs::schedule::IntoSystemConfig; pub use diagnostic::*; pub use entity_count_diagnostics_plugin::EntityCountDiagnosticsPlugin; pub use frame_time_diagnostics_plugin::FrameTimeDiagnosticsPlugin; diff --git a/crates/bevy_ecs/examples/change_detection.rs b/crates/bevy_ecs/examples/change_detection.rs index 16baa6c1a07cb..3ed5a5dcacb8f 100644 --- a/crates/bevy_ecs/examples/change_detection.rs +++ b/crates/bevy_ecs/examples/change_detection.rs @@ -1,4 +1,4 @@ -use bevy_ecs::{prelude::*, schedule_v3::IntoSystemConfig}; +use bevy_ecs::{prelude::*, schedule::IntoSystemConfig}; use rand::Rng; use std::ops::Deref; diff --git a/crates/bevy_ecs/macros/src/lib.rs b/crates/bevy_ecs/macros/src/lib.rs index be45ebe6f3b93..2d140f7b1a697 100644 --- a/crates/bevy_ecs/macros/src/lib.rs +++ b/crates/bevy_ecs/macros/src/lib.rs @@ -528,9 +528,7 @@ pub fn derive_world_query(input: TokenStream) -> TokenStream { pub fn derive_schedule_label(input: TokenStream) -> TokenStream { let input = parse_macro_input!(input as DeriveInput); let mut trait_path = bevy_ecs_path(); - trait_path - .segments - .push(format_ident!("schedule_v3").into()); + trait_path.segments.push(format_ident!("schedule").into()); trait_path .segments .push(format_ident!("ScheduleLabel").into()); @@ -542,9 +540,7 @@ pub fn derive_schedule_label(input: TokenStream) -> TokenStream { pub fn derive_system_set(input: TokenStream) -> TokenStream { let input = parse_macro_input!(input as DeriveInput); let mut trait_path = bevy_ecs_path(); - trait_path - .segments - .push(format_ident!("schedule_v3").into()); + trait_path.segments.push(format_ident!("schedule").into()); trait_path.segments.push(format_ident!("SystemSet").into()); derive_set(input, &trait_path) } diff --git a/crates/bevy_ecs/src/lib.rs b/crates/bevy_ecs/src/lib.rs index f6b1ddc693e56..92a9e080434fa 100644 --- a/crates/bevy_ecs/src/lib.rs +++ b/crates/bevy_ecs/src/lib.rs @@ -14,7 +14,7 @@ pub mod query; #[cfg(feature = "bevy_reflect")] pub mod reflect; pub mod removal_detection; -pub mod schedule_v3; +pub mod schedule; pub mod storage; pub mod system; pub mod world; @@ -35,7 +35,7 @@ pub mod prelude { event::{Event, EventReader, EventWriter, Events}, query::{Added, AnyOf, ChangeTrackers, Changed, Or, QueryState, With, Without}, removal_detection::RemovedComponents, - schedule_v3::{ + schedule::{ apply_state_transition, apply_system_buffers, common_conditions::*, IntoSystemConfig, IntoSystemConfigs, IntoSystemSet, IntoSystemSetConfig, IntoSystemSetConfigs, NextState, OnEnter, OnExit, OnUpdate, Schedule, Schedules, State, States, SystemSet, diff --git a/crates/bevy_ecs/src/schedule_v3/condition.rs b/crates/bevy_ecs/src/schedule/condition.rs similarity index 98% rename from crates/bevy_ecs/src/schedule_v3/condition.rs rename to crates/bevy_ecs/src/schedule/condition.rs index 8ddf8dee7abe1..7ee6c1723213d 100644 --- a/crates/bevy_ecs/src/schedule_v3/condition.rs +++ b/crates/bevy_ecs/src/schedule/condition.rs @@ -25,7 +25,7 @@ mod sealed { } pub mod common_conditions { - use crate::schedule_v3::{State, States}; + use crate::schedule::{State, States}; use crate::system::{Res, Resource}; /// Generates a [`Condition`](super::Condition)-satisfying closure that returns `true` diff --git a/crates/bevy_ecs/src/schedule_v3/config.rs b/crates/bevy_ecs/src/schedule/config.rs similarity index 99% rename from crates/bevy_ecs/src/schedule_v3/config.rs rename to crates/bevy_ecs/src/schedule/config.rs index bb171871f0462..0d27267b8d52d 100644 --- a/crates/bevy_ecs/src/schedule_v3/config.rs +++ b/crates/bevy_ecs/src/schedule/config.rs @@ -1,7 +1,7 @@ use bevy_ecs_macros::all_tuples; use crate::{ - schedule_v3::{ + schedule::{ condition::{BoxedCondition, Condition}, graph_utils::{Ambiguity, Dependency, DependencyKind, GraphInfo}, set::{BoxedSystemSet, IntoSystemSet, SystemSet}, @@ -488,7 +488,7 @@ impl IntoSystemConfig<()> for SystemConfig { // only `System` system objects can be scheduled mod sealed { use crate::{ - schedule_v3::{BoxedSystemSet, SystemSet}, + schedule::{BoxedSystemSet, SystemSet}, system::{BoxedSystem, IntoSystem}, }; diff --git a/crates/bevy_ecs/src/schedule_v3/executor/mod.rs b/crates/bevy_ecs/src/schedule/executor/mod.rs similarity index 98% rename from crates/bevy_ecs/src/schedule_v3/executor/mod.rs rename to crates/bevy_ecs/src/schedule/executor/mod.rs index 9ba5fdc8f0274..8ccee76887510 100644 --- a/crates/bevy_ecs/src/schedule_v3/executor/mod.rs +++ b/crates/bevy_ecs/src/schedule/executor/mod.rs @@ -9,7 +9,7 @@ pub use self::single_threaded::SingleThreadedExecutor; use fixedbitset::FixedBitSet; use crate::{ - schedule_v3::{BoxedCondition, NodeId}, + schedule::{BoxedCondition, NodeId}, system::BoxedSystem, world::World, }; diff --git a/crates/bevy_ecs/src/schedule_v3/executor/multi_threaded.rs b/crates/bevy_ecs/src/schedule/executor/multi_threaded.rs similarity index 99% rename from crates/bevy_ecs/src/schedule_v3/executor/multi_threaded.rs rename to crates/bevy_ecs/src/schedule/executor/multi_threaded.rs index 66bcc3c638523..258360a07a1b4 100644 --- a/crates/bevy_ecs/src/schedule_v3/executor/multi_threaded.rs +++ b/crates/bevy_ecs/src/schedule/executor/multi_threaded.rs @@ -14,7 +14,7 @@ use crate::{ archetype::ArchetypeComponentId, prelude::Resource, query::Access, - schedule_v3::{ + schedule::{ is_apply_system_buffers, BoxedCondition, ExecutorKind, SystemExecutor, SystemSchedule, }, system::BoxedSystem, diff --git a/crates/bevy_ecs/src/schedule_v3/executor/simple.rs b/crates/bevy_ecs/src/schedule/executor/simple.rs similarity index 95% rename from crates/bevy_ecs/src/schedule_v3/executor/simple.rs rename to crates/bevy_ecs/src/schedule/executor/simple.rs index 1e78e3655a86a..2aaf1777ed033 100644 --- a/crates/bevy_ecs/src/schedule_v3/executor/simple.rs +++ b/crates/bevy_ecs/src/schedule/executor/simple.rs @@ -3,11 +3,11 @@ use bevy_utils::tracing::info_span; use fixedbitset::FixedBitSet; use crate::{ - schedule_v3::{BoxedCondition, ExecutorKind, SystemExecutor, SystemSchedule}, + schedule::{BoxedCondition, ExecutorKind, SystemExecutor, SystemSchedule}, world::World, }; -/// A variant of [`SingleThreadedExecutor`](crate::schedule_v3::SingleThreadedExecutor) that calls +/// A variant of [`SingleThreadedExecutor`](crate::schedule::SingleThreadedExecutor) that calls /// [`apply_buffers`](crate::system::System::apply_buffers) immediately after running each system. #[derive(Default)] pub struct SimpleExecutor { diff --git a/crates/bevy_ecs/src/schedule_v3/executor/single_threaded.rs b/crates/bevy_ecs/src/schedule/executor/single_threaded.rs similarity index 99% rename from crates/bevy_ecs/src/schedule_v3/executor/single_threaded.rs rename to crates/bevy_ecs/src/schedule/executor/single_threaded.rs index a54f3a6378a4b..61b4520684e68 100644 --- a/crates/bevy_ecs/src/schedule_v3/executor/single_threaded.rs +++ b/crates/bevy_ecs/src/schedule/executor/single_threaded.rs @@ -3,7 +3,7 @@ use bevy_utils::tracing::info_span; use fixedbitset::FixedBitSet; use crate::{ - schedule_v3::{ + schedule::{ is_apply_system_buffers, BoxedCondition, ExecutorKind, SystemExecutor, SystemSchedule, }, world::World, diff --git a/crates/bevy_ecs/src/schedule_v3/graph_utils.rs b/crates/bevy_ecs/src/schedule/graph_utils.rs similarity index 99% rename from crates/bevy_ecs/src/schedule_v3/graph_utils.rs rename to crates/bevy_ecs/src/schedule/graph_utils.rs index 509bd176e08e4..03ec42bd47c65 100644 --- a/crates/bevy_ecs/src/schedule_v3/graph_utils.rs +++ b/crates/bevy_ecs/src/schedule/graph_utils.rs @@ -6,7 +6,7 @@ use bevy_utils::{ }; use fixedbitset::FixedBitSet; -use crate::schedule_v3::set::*; +use crate::schedule::set::*; /// Unique identifier for a system or system set. #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] diff --git a/crates/bevy_ecs/src/schedule_v3/mod.rs b/crates/bevy_ecs/src/schedule/mod.rs similarity index 99% rename from crates/bevy_ecs/src/schedule_v3/mod.rs rename to crates/bevy_ecs/src/schedule/mod.rs index 05408305c125e..5ad27d2b071fc 100644 --- a/crates/bevy_ecs/src/schedule_v3/mod.rs +++ b/crates/bevy_ecs/src/schedule/mod.rs @@ -2,6 +2,7 @@ mod condition; mod config; mod executor; mod graph_utils; +#[allow(clippy::module_inception)] mod schedule; mod set; mod state; @@ -20,7 +21,7 @@ mod tests { use std::sync::atomic::{AtomicU32, Ordering}; pub use crate as bevy_ecs; - pub use crate::schedule_v3::{IntoSystemConfig, IntoSystemSetConfig, Schedule, SystemSet}; + pub use crate::schedule::{IntoSystemConfig, IntoSystemSetConfig, Schedule, SystemSet}; pub use crate::system::{Res, ResMut}; pub use crate::{prelude::World, system::Resource}; diff --git a/crates/bevy_ecs/src/schedule_v3/schedule.rs b/crates/bevy_ecs/src/schedule/schedule.rs similarity index 99% rename from crates/bevy_ecs/src/schedule_v3/schedule.rs rename to crates/bevy_ecs/src/schedule/schedule.rs index 45ecd92ec3355..3c64995a106f2 100644 --- a/crates/bevy_ecs/src/schedule_v3/schedule.rs +++ b/crates/bevy_ecs/src/schedule/schedule.rs @@ -18,7 +18,7 @@ use fixedbitset::FixedBitSet; use crate::{ self as bevy_ecs, component::{ComponentId, Components}, - schedule_v3::*, + schedule::*, system::{BoxedSystem, Resource}, world::World, }; diff --git a/crates/bevy_ecs/src/schedule_v3/set.rs b/crates/bevy_ecs/src/schedule/set.rs similarity index 100% rename from crates/bevy_ecs/src/schedule_v3/set.rs rename to crates/bevy_ecs/src/schedule/set.rs diff --git a/crates/bevy_ecs/src/schedule_v3/state.rs b/crates/bevy_ecs/src/schedule/state.rs similarity index 97% rename from crates/bevy_ecs/src/schedule_v3/state.rs rename to crates/bevy_ecs/src/schedule/state.rs index cac1a4ed5d492..975ae9d7c1c3a 100644 --- a/crates/bevy_ecs/src/schedule_v3/state.rs +++ b/crates/bevy_ecs/src/schedule/state.rs @@ -3,7 +3,7 @@ use std::hash::Hash; use std::mem; use crate as bevy_ecs; -use crate::schedule_v3::{ScheduleLabel, SystemSet}; +use crate::schedule::{ScheduleLabel, SystemSet}; use crate::system::Resource; use crate::world::World; @@ -61,7 +61,7 @@ pub struct OnExit(pub S); /// A [`SystemSet`] that will run within `CoreSet::StateTransitions` when this state is active. /// -/// This is provided for convenience. A more general [`state_equals`](crate::schedule_v3::common_conditions::state_equals) +/// This is provided for convenience. A more general [`state_equals`](crate::schedule::common_conditions::state_equals) /// [condition](super::Condition) also exists for systems that need to run elsewhere. #[derive(SystemSet, Clone, Debug, PartialEq, Eq, Hash)] pub struct OnUpdate(pub S); diff --git a/crates/bevy_ecs/src/system/commands/mod.rs b/crates/bevy_ecs/src/system/commands/mod.rs index 06acb572d9e6a..3d01036dede0d 100644 --- a/crates/bevy_ecs/src/system/commands/mod.rs +++ b/crates/bevy_ecs/src/system/commands/mod.rs @@ -95,8 +95,8 @@ pub trait Command: Send + 'static { /// ``` /// /// [`System::apply_buffers`]: crate::system::System::apply_buffers -/// [`apply_system_buffers`]: crate::schedule_v3::apply_system_buffers -/// [`Schedule::apply_system_buffers`]: crate::schedule_v3::Schedule::apply_system_buffers +/// [`apply_system_buffers`]: crate::schedule::apply_system_buffers +/// [`Schedule::apply_system_buffers`]: crate::schedule::Schedule::apply_system_buffers pub struct Commands<'w, 's> { queue: &'s mut CommandQueue, entities: &'w Entities, diff --git a/crates/bevy_ecs/src/system/exclusive_function_system.rs b/crates/bevy_ecs/src/system/exclusive_function_system.rs index 78b7b27379b2e..7853586bdfee6 100644 --- a/crates/bevy_ecs/src/system/exclusive_function_system.rs +++ b/crates/bevy_ecs/src/system/exclusive_function_system.rs @@ -155,8 +155,8 @@ where ); } - fn default_system_sets(&self) -> Vec> { - let set = crate::schedule_v3::SystemTypeSet::::new(); + fn default_system_sets(&self) -> Vec> { + let set = crate::schedule::SystemTypeSet::::new(); vec![Box::new(set)] } } diff --git a/crates/bevy_ecs/src/system/function_system.rs b/crates/bevy_ecs/src/system/function_system.rs index d9a9cd1ebf58e..b1e4c73e86332 100644 --- a/crates/bevy_ecs/src/system/function_system.rs +++ b/crates/bevy_ecs/src/system/function_system.rs @@ -522,8 +522,8 @@ where ); } - fn default_system_sets(&self) -> Vec> { - let set = crate::schedule_v3::SystemTypeSet::::new(); + fn default_system_sets(&self) -> Vec> { + let set = crate::schedule::SystemTypeSet::::new(); vec![Box::new(set)] } } diff --git a/crates/bevy_ecs/src/system/mod.rs b/crates/bevy_ecs/src/system/mod.rs index 1b3b735afeb46..7b8922e79c72a 100644 --- a/crates/bevy_ecs/src/system/mod.rs +++ b/crates/bevy_ecs/src/system/mod.rs @@ -1,7 +1,7 @@ //! Tools for controlling behavior in an ECS application. //! //! Systems define how an ECS based application behaves. -//! Systems are added to a [`Schedule`](crate::schedule_v3::Schedule), which is then run. +//! Systems are added to a [`Schedule`](crate::schedule::Schedule), which is then run. //! A system is usually written as a normal function, which is automatically converted into a system. //! //! System functions can have parameters, through which one can query and mutate Bevy ECS state. @@ -49,7 +49,7 @@ //! - by adding them to a [`SystemSet`], and then using `.configure_set(ThisSet.before(ThatSet))` syntax to configure many systems at once //! - through the use of `.add_systems((system_a, system_b, system_c).chain())` //! -//! [`SystemSet`]: crate::schedule_v3::SystemSet +//! [`SystemSet`]: crate::schedule::SystemSet //! //! ## Example //! @@ -144,7 +144,7 @@ mod tests { prelude::AnyOf, query::{Added, Changed, Or, With, Without}, removal_detection::RemovedComponents, - schedule_v3::{apply_system_buffers, IntoSystemConfig, Schedule}, + schedule::{apply_system_buffers, IntoSystemConfig, Schedule}, system::{ Commands, IntoSystem, Local, NonSend, NonSendMut, ParamSet, Query, QueryComponentError, Res, ResMut, Resource, System, SystemState, diff --git a/crates/bevy_ecs/src/system/system.rs b/crates/bevy_ecs/src/system/system.rs index d8256765210d4..dbbe58156834f 100644 --- a/crates/bevy_ecs/src/system/system.rs +++ b/crates/bevy_ecs/src/system/system.rs @@ -9,7 +9,7 @@ use crate::{ use std::any::TypeId; use std::borrow::Cow; -/// An ECS system that can be added to a [`Schedule`](crate::schedule_v3::Schedule) +/// An ECS system that can be added to a [`Schedule`](crate::schedule::Schedule) /// /// Systems are functions with all arguments implementing /// [`SystemParam`](crate::system::SystemParam). @@ -19,7 +19,7 @@ use std::borrow::Cow; /// /// Systems are executed in parallel, in opportunistic order; data access is managed automatically. /// It's possible to specify explicit execution order between specific systems, -/// see [`IntoSystemConfig`](crate::schedule_v3::IntoSystemConfig). +/// see [`IntoSystemConfig`](crate::schedule::IntoSystemConfig). pub trait System: Send + Sync + 'static { /// The system's input. See [`In`](crate::system::In) for /// [`FunctionSystem`](crate::system::FunctionSystem)s. @@ -64,8 +64,8 @@ pub trait System: Send + Sync + 'static { /// Update the system's archetype component [`Access`]. fn update_archetype_component_access(&mut self, world: &World); fn check_change_tick(&mut self, change_tick: u32); - /// Returns the system's default [system sets](crate::schedule_v3::SystemSet). - fn default_system_sets(&self) -> Vec> { + /// Returns the system's default [system sets](crate::schedule::SystemSet). + fn default_system_sets(&self) -> Vec> { Vec::new() } /// Gets the system's last change tick diff --git a/crates/bevy_ecs/src/system/system_piping.rs b/crates/bevy_ecs/src/system/system_piping.rs index 93798b730441f..62eb057defc94 100644 --- a/crates/bevy_ecs/src/system/system_piping.rs +++ b/crates/bevy_ecs/src/system/system_piping.rs @@ -146,7 +146,7 @@ impl> System for PipeSystem< self.system_b.set_last_change_tick(last_change_tick); } - fn default_system_sets(&self) -> Vec> { + fn default_system_sets(&self) -> Vec> { let mut system_sets = self.system_a.default_system_sets(); system_sets.extend_from_slice(&self.system_b.default_system_sets()); system_sets diff --git a/crates/bevy_ecs/src/world/mod.rs b/crates/bevy_ecs/src/world/mod.rs index fab437338e71e..6029bd43ea455 100644 --- a/crates/bevy_ecs/src/world/mod.rs +++ b/crates/bevy_ecs/src/world/mod.rs @@ -20,7 +20,7 @@ use crate::{ event::{Event, Events}, query::{DebugCheckedUnwrap, QueryState, ReadOnlyWorldQuery, WorldQuery}, removal_detection::RemovedComponentEvents, - schedule_v3::{Schedule, ScheduleLabel, Schedules}, + schedule::{Schedule, ScheduleLabel, Schedules}, storage::{Column, ComponentSparseSet, ResourceData, Storages, TableRow}, system::Resource, }; @@ -1572,7 +1572,7 @@ impl World { resources.check_change_ticks(change_tick); non_send_resources.check_change_ticks(change_tick); - if let Some(mut schedules) = self.get_resource_mut::() { + if let Some(mut schedules) = self.get_resource_mut::() { schedules.check_change_ticks(change_tick); } diff --git a/crates/bevy_input/src/input.rs b/crates/bevy_input/src/input.rs index 45d6a7a3ef6f4..a22145ea64f5d 100644 --- a/crates/bevy_input/src/input.rs +++ b/crates/bevy_input/src/input.rs @@ -5,7 +5,7 @@ use std::hash::Hash; // unused import, but needed for intra doc link to work #[allow(unused_imports)] -use bevy_ecs::schedule_v3::State; +use bevy_ecs::schedule::State; /// A "press-able" input of type `T`. /// @@ -22,7 +22,7 @@ use bevy_ecs::schedule_v3::State; /// /// In case multiple systems are checking for [`Input::just_pressed`] or [`Input::just_released`] /// but only one should react, for example in the case of triggering -/// [`State`](bevy_ecs::schedule_v3::State) change, you should consider clearing the input state, either by: +/// [`State`](bevy_ecs::schedule::State) change, you should consider clearing the input state, either by: /// /// * Using [`Input::clear_just_pressed`] or [`Input::clear_just_released`] instead. /// * Calling [`Input::clear`] or [`Input::reset`] immediately after the state change. diff --git a/crates/bevy_render/src/lib.rs b/crates/bevy_render/src/lib.rs index 1635ee1072e5e..cbf41721ace48 100644 --- a/crates/bevy_render/src/lib.rs +++ b/crates/bevy_render/src/lib.rs @@ -53,7 +53,7 @@ use crate::{ }; use bevy_app::{App, AppLabel, CoreSchedule, Plugin, SubApp}; use bevy_asset::{AddAsset, AssetServer}; -use bevy_ecs::{prelude::*, schedule_v3::ScheduleLabel, system::SystemState}; +use bevy_ecs::{prelude::*, schedule::ScheduleLabel, system::SystemState}; use bevy_utils::tracing::debug; use std::ops::{Deref, DerefMut}; @@ -136,7 +136,7 @@ impl RenderSet { /// running the next frame while rendering the current frame. /// /// This schedule is run on the main world, but its buffers are not applied -/// via [`Schedule::apply_system_buffers`](bevy_ecs::schedule_v3::Schedule) until it is returned to the render world. +/// via [`Schedule::apply_system_buffers`](bevy_ecs::schedule::Schedule) until it is returned to the render world. #[derive(ScheduleLabel, PartialEq, Eq, Debug, Clone, Hash)] pub struct ExtractSchedule; diff --git a/crates/bevy_render/src/pipelined_rendering.rs b/crates/bevy_render/src/pipelined_rendering.rs index 210fb8d08e5d3..b4710b60adcfa 100644 --- a/crates/bevy_render/src/pipelined_rendering.rs +++ b/crates/bevy_render/src/pipelined_rendering.rs @@ -2,7 +2,7 @@ use async_channel::{Receiver, Sender}; use bevy_app::{App, AppLabel, CoreSchedule, Plugin, SubApp}; use bevy_ecs::{ - schedule_v3::MainThreadExecutor, + schedule::MainThreadExecutor, system::Resource, world::{Mut, World}, }; diff --git a/crates/bevy_time/src/fixed_timestep.rs b/crates/bevy_time/src/fixed_timestep.rs index e37bbd7ac7f25..7fa9d6ff2ca1d 100644 --- a/crates/bevy_time/src/fixed_timestep.rs +++ b/crates/bevy_time/src/fixed_timestep.rs @@ -1,7 +1,7 @@ //! Tools to run systems at a regular interval. //! This can be extremely useful for steady, frame-rate independent gameplay logic and physics. //! -//! To run a system on a fixed timestep, add it to the [`CoreSchedule::FixedUpdate`] [`Schedule`](bevy_ecs::schedule_v3::Schedule). +//! To run a system on a fixed timestep, add it to the [`CoreSchedule::FixedUpdate`] [`Schedule`](bevy_ecs::schedule::Schedule). //! This schedules is run in the [`CoreSet::FixedUpdate`](bevy_app::CoreSet::FixedUpdate) near the start of each frame, //! via the [`run_fixed_update_schedule`] exclusive system. //! diff --git a/crates/bevy_ui/src/stack.rs b/crates/bevy_ui/src/stack.rs index 6a675bada46fa..47cfac0d1021b 100644 --- a/crates/bevy_ui/src/stack.rs +++ b/crates/bevy_ui/src/stack.rs @@ -105,7 +105,7 @@ fn fill_stack_recursively(result: &mut Vec, stack: &mut StackingContext) mod tests { use bevy_ecs::{ component::Component, - schedule_v3::Schedule, + schedule::Schedule, system::{CommandQueue, Commands}, world::World, }; diff --git a/examples/ecs/nondeterministic_system_order.rs b/examples/ecs/nondeterministic_system_order.rs index 1827ddc7e377b..376159e6d65a7 100644 --- a/examples/ecs/nondeterministic_system_order.rs +++ b/examples/ecs/nondeterministic_system_order.rs @@ -13,7 +13,7 @@ //! This example demonstrates how you might detect and resolve (or silence) these ambiguities. use bevy::{ - ecs::schedule_v3::{LogLevel, ScheduleBuildSettings}, + ecs::schedule::{LogLevel, ScheduleBuildSettings}, prelude::*, };