Rename schedule v3 to schedule (#7519)

# Objective

- Follow up of https://github.com/bevyengine/bevy/pull/7267

## Solution

- Rename schedule_v3 to schedule
- Suppress "module inception" lint
This commit is contained in:
张林伟 2023-02-06 18:44:40 +00:00
parent a9e2dee732
commit aa4170d9a4
33 changed files with 62 additions and 65 deletions

View File

@ -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}; use criterion::{BenchmarkId, Criterion};
#[derive(Component)] #[derive(Component)]

View File

@ -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; use criterion::Criterion;
#[derive(Component)] #[derive(Component)]

View File

@ -2,7 +2,7 @@ use crate::{CoreSchedule, CoreSet, Plugin, PluginGroup, StartupSet};
pub use bevy_derive::AppLabel; pub use bevy_derive::AppLabel;
use bevy_ecs::{ use bevy_ecs::{
prelude::*, prelude::*,
schedule_v3::{ schedule::{
apply_state_transition, common_conditions::run_once as run_once_condition, apply_state_transition, common_conditions::run_once as run_once_condition,
run_enter_schedule, BoxedScheduleLabel, IntoSystemConfig, IntoSystemSetConfigs, run_enter_schedule, BoxedScheduleLabel, IntoSystemConfig, IntoSystemSetConfigs,
ScheduleLabel, ScheduleLabel,
@ -100,7 +100,7 @@ impl Debug for App {
/// ```rust /// ```rust
/// # use bevy_app::{App, AppLabel, SubApp, CoreSchedule}; /// # use bevy_app::{App, AppLabel, SubApp, CoreSchedule};
/// # use bevy_ecs::prelude::*; /// # use bevy_ecs::prelude::*;
/// # use bevy_ecs::schedule_v3::ScheduleLabel; /// # use bevy_ecs::schedule::ScheduleLabel;
/// ///
/// #[derive(Resource, Default)] /// #[derive(Resource, Default)]
/// struct Val(pub i32); /// struct Val(pub i32);
@ -315,7 +315,7 @@ impl App {
/// These systems sets only run if the [`State<S>`] resource matches their label. /// These systems sets only run if the [`State<S>`] resource matches their label.
/// ///
/// If you would like to control how other systems run based on the current state, /// 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 /// Note that you can also apply state transitions at other points in the schedule
/// by adding the [`apply_state_transition`] system manually. /// by adding the [`apply_state_transition`] system manually.
@ -526,7 +526,7 @@ impl App {
/// ///
/// ``` /// ```
/// use bevy_app::App; /// use bevy_app::App;
/// use bevy_ecs::schedule_v3::Schedules; /// use bevy_ecs::schedule::Schedules;
/// ///
/// let app = App::empty() /// let app = App::empty()
/// .init_resource::<Schedules>() /// .init_resource::<Schedules>()
@ -549,7 +549,7 @@ impl App {
} }
self.edit_schedule(CoreSchedule::Outer, |schedule| { 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); schedule.add_system(run_main_schedule);
}); });

View File

@ -28,7 +28,7 @@ pub mod prelude {
} }
use bevy_ecs::{ use bevy_ecs::{
schedule_v3::{ schedule::{
apply_system_buffers, IntoSystemConfig, IntoSystemSetConfig, IntoSystemSetConfigs, apply_system_buffers, IntoSystemConfig, IntoSystemSetConfig, IntoSystemSetConfigs,
Schedule, ScheduleLabel, SystemSet, Schedule, ScheduleLabel, SystemSet,
}, },
@ -38,7 +38,7 @@ use bevy_ecs::{
/// The names of the default [`App`] schedules. /// 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)] #[derive(ScheduleLabel, Clone, Debug, PartialEq, Eq, Hash)]
pub enum CoreSchedule { pub enum CoreSchedule {
/// The schedule that runs once when the app starts. /// 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. /// Initializes a single threaded schedule for [`CoreSchedule::Outer`] that contains the [`outer_loop`](CoreSchedule::outer_loop) system.
pub fn outer_schedule() -> Schedule { pub fn outer_schedule() -> Schedule {
let mut schedule = Schedule::new(); 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.add_system(Self::outer_loop);
schedule schedule
} }
@ -84,7 +84,7 @@ impl CoreSchedule {
/// ///
/// These are ordered in the same order they are listed. /// 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`] /// The `*Flush` sets are assigned to the copy of [`apply_system_buffers`]
/// that runs immediately after the matching system set. /// that runs immediately after the matching system set.
@ -100,7 +100,7 @@ pub enum CoreSet {
PreUpdate, PreUpdate,
/// The copy of [`apply_system_buffers`] that runs immediately after `PreUpdate`. /// The copy of [`apply_system_buffers`] that runs immediately after `PreUpdate`.
PreUpdateFlush, PreUpdateFlush,
/// Applies [`State`](bevy_ecs::schedule_v3::State) transitions /// Applies [`State`](bevy_ecs::schedule::State) transitions
StateTransitions, StateTransitions,
/// Runs systems that should only occur after a fixed period of time. /// 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 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`] /// The `*Flush` sets are assigned to the copy of [`apply_system_buffers`]
/// that runs immediately after the matching system set. /// that runs immediately after the matching system set.

View File

@ -11,14 +11,14 @@ use std::{cell::RefCell, rc::Rc};
#[cfg(target_arch = "wasm32")] #[cfg(target_arch = "wasm32")]
use wasm_bindgen::{prelude::*, JsCast}; 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`]. /// It is used in the [`ScheduleRunnerSettings`].
#[derive(Copy, Clone, Debug)] #[derive(Copy, Clone, Debug)]
pub enum RunMode { pub enum RunMode {
/// Indicates that the [`App`]'s schedule should run repeatedly. /// Indicates that the [`App`]'s schedule should run repeatedly.
Loop { 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. /// has completed before repeating. A value of [`None`] will not wait.
wait: Option<Duration>, wait: Option<Duration>,
}, },
@ -37,7 +37,7 @@ impl Default for RunMode {
/// It gets added as a [`Resource`](bevy_ecs::system::Resource) inside of the [`ScheduleRunnerPlugin`]. /// It gets added as a [`Resource`](bevy_ecs::system::Resource) inside of the [`ScheduleRunnerPlugin`].
#[derive(Copy, Clone, Default, Resource)] #[derive(Copy, Clone, Default, Resource)]
pub struct ScheduleRunnerSettings { 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, 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`]. /// [`RunMode`].
/// ///
/// [`ScheduleRunnerPlugin`] is included in the /// [`ScheduleRunnerPlugin`] is included in the
@ -67,7 +67,7 @@ impl ScheduleRunnerSettings {
/// ///
/// [`ScheduleRunnerPlugin`] is *not* included in the /// [`ScheduleRunnerPlugin`] is *not* included in the
/// [`DefaultPlugins`](https://docs.rs/bevy/latest/bevy/struct.DefaultPlugins.html) plugin group /// [`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 /// typically, the `winit` event loop
/// (see [`WinitPlugin`](https://docs.rs/bevy/latest/bevy/winit/struct.WinitPlugin.html)) /// (see [`WinitPlugin`](https://docs.rs/bevy/latest/bevy/winit/struct.WinitPlugin.html))
/// executes the schedule making [`ScheduleRunnerPlugin`] unnecessary. /// executes the schedule making [`ScheduleRunnerPlugin`] unnecessary.

View File

@ -5,7 +5,7 @@ mod log_diagnostics_plugin;
mod system_information_diagnostics_plugin; mod system_information_diagnostics_plugin;
use bevy_app::prelude::*; use bevy_app::prelude::*;
use bevy_ecs::schedule_v3::IntoSystemConfig; use bevy_ecs::schedule::IntoSystemConfig;
pub use diagnostic::*; pub use diagnostic::*;
pub use entity_count_diagnostics_plugin::EntityCountDiagnosticsPlugin; pub use entity_count_diagnostics_plugin::EntityCountDiagnosticsPlugin;
pub use frame_time_diagnostics_plugin::FrameTimeDiagnosticsPlugin; pub use frame_time_diagnostics_plugin::FrameTimeDiagnosticsPlugin;

View File

@ -1,4 +1,4 @@
use bevy_ecs::{prelude::*, schedule_v3::IntoSystemConfig}; use bevy_ecs::{prelude::*, schedule::IntoSystemConfig};
use rand::Rng; use rand::Rng;
use std::ops::Deref; use std::ops::Deref;

View File

@ -528,9 +528,7 @@ pub fn derive_world_query(input: TokenStream) -> TokenStream {
pub fn derive_schedule_label(input: TokenStream) -> TokenStream { pub fn derive_schedule_label(input: TokenStream) -> TokenStream {
let input = parse_macro_input!(input as DeriveInput); let input = parse_macro_input!(input as DeriveInput);
let mut trait_path = bevy_ecs_path(); let mut trait_path = bevy_ecs_path();
trait_path trait_path.segments.push(format_ident!("schedule").into());
.segments
.push(format_ident!("schedule_v3").into());
trait_path trait_path
.segments .segments
.push(format_ident!("ScheduleLabel").into()); .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 { pub fn derive_system_set(input: TokenStream) -> TokenStream {
let input = parse_macro_input!(input as DeriveInput); let input = parse_macro_input!(input as DeriveInput);
let mut trait_path = bevy_ecs_path(); let mut trait_path = bevy_ecs_path();
trait_path trait_path.segments.push(format_ident!("schedule").into());
.segments
.push(format_ident!("schedule_v3").into());
trait_path.segments.push(format_ident!("SystemSet").into()); trait_path.segments.push(format_ident!("SystemSet").into());
derive_set(input, &trait_path) derive_set(input, &trait_path)
} }

View File

@ -14,7 +14,7 @@ pub mod query;
#[cfg(feature = "bevy_reflect")] #[cfg(feature = "bevy_reflect")]
pub mod reflect; pub mod reflect;
pub mod removal_detection; pub mod removal_detection;
pub mod schedule_v3; pub mod schedule;
pub mod storage; pub mod storage;
pub mod system; pub mod system;
pub mod world; pub mod world;
@ -35,7 +35,7 @@ pub mod prelude {
event::{Event, EventReader, EventWriter, Events}, event::{Event, EventReader, EventWriter, Events},
query::{Added, AnyOf, ChangeTrackers, Changed, Or, QueryState, With, Without}, query::{Added, AnyOf, ChangeTrackers, Changed, Or, QueryState, With, Without},
removal_detection::RemovedComponents, removal_detection::RemovedComponents,
schedule_v3::{ schedule::{
apply_state_transition, apply_system_buffers, common_conditions::*, IntoSystemConfig, apply_state_transition, apply_system_buffers, common_conditions::*, IntoSystemConfig,
IntoSystemConfigs, IntoSystemSet, IntoSystemSetConfig, IntoSystemSetConfigs, NextState, IntoSystemConfigs, IntoSystemSet, IntoSystemSetConfig, IntoSystemSetConfigs, NextState,
OnEnter, OnExit, OnUpdate, Schedule, Schedules, State, States, SystemSet, OnEnter, OnExit, OnUpdate, Schedule, Schedules, State, States, SystemSet,

View File

@ -25,7 +25,7 @@ mod sealed {
} }
pub mod common_conditions { pub mod common_conditions {
use crate::schedule_v3::{State, States}; use crate::schedule::{State, States};
use crate::system::{Res, Resource}; use crate::system::{Res, Resource};
/// Generates a [`Condition`](super::Condition)-satisfying closure that returns `true` /// Generates a [`Condition`](super::Condition)-satisfying closure that returns `true`

View File

@ -1,7 +1,7 @@
use bevy_ecs_macros::all_tuples; use bevy_ecs_macros::all_tuples;
use crate::{ use crate::{
schedule_v3::{ schedule::{
condition::{BoxedCondition, Condition}, condition::{BoxedCondition, Condition},
graph_utils::{Ambiguity, Dependency, DependencyKind, GraphInfo}, graph_utils::{Ambiguity, Dependency, DependencyKind, GraphInfo},
set::{BoxedSystemSet, IntoSystemSet, SystemSet}, set::{BoxedSystemSet, IntoSystemSet, SystemSet},
@ -488,7 +488,7 @@ impl IntoSystemConfig<()> for SystemConfig {
// only `System<In=(), Out=()>` system objects can be scheduled // only `System<In=(), Out=()>` system objects can be scheduled
mod sealed { mod sealed {
use crate::{ use crate::{
schedule_v3::{BoxedSystemSet, SystemSet}, schedule::{BoxedSystemSet, SystemSet},
system::{BoxedSystem, IntoSystem}, system::{BoxedSystem, IntoSystem},
}; };

View File

@ -9,7 +9,7 @@ pub use self::single_threaded::SingleThreadedExecutor;
use fixedbitset::FixedBitSet; use fixedbitset::FixedBitSet;
use crate::{ use crate::{
schedule_v3::{BoxedCondition, NodeId}, schedule::{BoxedCondition, NodeId},
system::BoxedSystem, system::BoxedSystem,
world::World, world::World,
}; };

View File

@ -14,7 +14,7 @@ use crate::{
archetype::ArchetypeComponentId, archetype::ArchetypeComponentId,
prelude::Resource, prelude::Resource,
query::Access, query::Access,
schedule_v3::{ schedule::{
is_apply_system_buffers, BoxedCondition, ExecutorKind, SystemExecutor, SystemSchedule, is_apply_system_buffers, BoxedCondition, ExecutorKind, SystemExecutor, SystemSchedule,
}, },
system::BoxedSystem, system::BoxedSystem,

View File

@ -3,11 +3,11 @@ use bevy_utils::tracing::info_span;
use fixedbitset::FixedBitSet; use fixedbitset::FixedBitSet;
use crate::{ use crate::{
schedule_v3::{BoxedCondition, ExecutorKind, SystemExecutor, SystemSchedule}, schedule::{BoxedCondition, ExecutorKind, SystemExecutor, SystemSchedule},
world::World, 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. /// [`apply_buffers`](crate::system::System::apply_buffers) immediately after running each system.
#[derive(Default)] #[derive(Default)]
pub struct SimpleExecutor { pub struct SimpleExecutor {

View File

@ -3,7 +3,7 @@ use bevy_utils::tracing::info_span;
use fixedbitset::FixedBitSet; use fixedbitset::FixedBitSet;
use crate::{ use crate::{
schedule_v3::{ schedule::{
is_apply_system_buffers, BoxedCondition, ExecutorKind, SystemExecutor, SystemSchedule, is_apply_system_buffers, BoxedCondition, ExecutorKind, SystemExecutor, SystemSchedule,
}, },
world::World, world::World,

View File

@ -6,7 +6,7 @@ use bevy_utils::{
}; };
use fixedbitset::FixedBitSet; use fixedbitset::FixedBitSet;
use crate::schedule_v3::set::*; use crate::schedule::set::*;
/// Unique identifier for a system or system set. /// Unique identifier for a system or system set.
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]

View File

@ -2,6 +2,7 @@ mod condition;
mod config; mod config;
mod executor; mod executor;
mod graph_utils; mod graph_utils;
#[allow(clippy::module_inception)]
mod schedule; mod schedule;
mod set; mod set;
mod state; mod state;
@ -20,7 +21,7 @@ mod tests {
use std::sync::atomic::{AtomicU32, Ordering}; use std::sync::atomic::{AtomicU32, Ordering};
pub use crate as bevy_ecs; 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::system::{Res, ResMut};
pub use crate::{prelude::World, system::Resource}; pub use crate::{prelude::World, system::Resource};

View File

@ -18,7 +18,7 @@ use fixedbitset::FixedBitSet;
use crate::{ use crate::{
self as bevy_ecs, self as bevy_ecs,
component::{ComponentId, Components}, component::{ComponentId, Components},
schedule_v3::*, schedule::*,
system::{BoxedSystem, Resource}, system::{BoxedSystem, Resource},
world::World, world::World,
}; };

View File

@ -3,7 +3,7 @@ use std::hash::Hash;
use std::mem; use std::mem;
use crate as bevy_ecs; use crate as bevy_ecs;
use crate::schedule_v3::{ScheduleLabel, SystemSet}; use crate::schedule::{ScheduleLabel, SystemSet};
use crate::system::Resource; use crate::system::Resource;
use crate::world::World; use crate::world::World;
@ -61,7 +61,7 @@ pub struct OnExit<S: States>(pub S);
/// A [`SystemSet`] that will run within `CoreSet::StateTransitions` when this state is active. /// 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. /// [condition](super::Condition) also exists for systems that need to run elsewhere.
#[derive(SystemSet, Clone, Debug, PartialEq, Eq, Hash)] #[derive(SystemSet, Clone, Debug, PartialEq, Eq, Hash)]
pub struct OnUpdate<S: States>(pub S); pub struct OnUpdate<S: States>(pub S);

View File

@ -95,8 +95,8 @@ pub trait Command: Send + 'static {
/// ``` /// ```
/// ///
/// [`System::apply_buffers`]: crate::system::System::apply_buffers /// [`System::apply_buffers`]: crate::system::System::apply_buffers
/// [`apply_system_buffers`]: crate::schedule_v3::apply_system_buffers /// [`apply_system_buffers`]: crate::schedule::apply_system_buffers
/// [`Schedule::apply_system_buffers`]: crate::schedule_v3::Schedule::apply_system_buffers /// [`Schedule::apply_system_buffers`]: crate::schedule::Schedule::apply_system_buffers
pub struct Commands<'w, 's> { pub struct Commands<'w, 's> {
queue: &'s mut CommandQueue, queue: &'s mut CommandQueue,
entities: &'w Entities, entities: &'w Entities,

View File

@ -155,8 +155,8 @@ where
); );
} }
fn default_system_sets(&self) -> Vec<Box<dyn crate::schedule_v3::SystemSet>> { fn default_system_sets(&self) -> Vec<Box<dyn crate::schedule::SystemSet>> {
let set = crate::schedule_v3::SystemTypeSet::<F>::new(); let set = crate::schedule::SystemTypeSet::<F>::new();
vec![Box::new(set)] vec![Box::new(set)]
} }
} }

View File

@ -522,8 +522,8 @@ where
); );
} }
fn default_system_sets(&self) -> Vec<Box<dyn crate::schedule_v3::SystemSet>> { fn default_system_sets(&self) -> Vec<Box<dyn crate::schedule::SystemSet>> {
let set = crate::schedule_v3::SystemTypeSet::<F>::new(); let set = crate::schedule::SystemTypeSet::<F>::new();
vec![Box::new(set)] vec![Box::new(set)]
} }
} }

View File

@ -1,7 +1,7 @@
//! Tools for controlling behavior in an ECS application. //! Tools for controlling behavior in an ECS application.
//! //!
//! Systems define how an ECS based application behaves. //! 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. //! 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. //! 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 //! - 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())` //! - through the use of `.add_systems((system_a, system_b, system_c).chain())`
//! //!
//! [`SystemSet`]: crate::schedule_v3::SystemSet //! [`SystemSet`]: crate::schedule::SystemSet
//! //!
//! ## Example //! ## Example
//! //!
@ -144,7 +144,7 @@ mod tests {
prelude::AnyOf, prelude::AnyOf,
query::{Added, Changed, Or, With, Without}, query::{Added, Changed, Or, With, Without},
removal_detection::RemovedComponents, removal_detection::RemovedComponents,
schedule_v3::{apply_system_buffers, IntoSystemConfig, Schedule}, schedule::{apply_system_buffers, IntoSystemConfig, Schedule},
system::{ system::{
Commands, IntoSystem, Local, NonSend, NonSendMut, ParamSet, Query, QueryComponentError, Commands, IntoSystem, Local, NonSend, NonSendMut, ParamSet, Query, QueryComponentError,
Res, ResMut, Resource, System, SystemState, Res, ResMut, Resource, System, SystemState,

View File

@ -9,7 +9,7 @@ use crate::{
use std::any::TypeId; use std::any::TypeId;
use std::borrow::Cow; 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 /// Systems are functions with all arguments implementing
/// [`SystemParam`](crate::system::SystemParam). /// [`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. /// Systems are executed in parallel, in opportunistic order; data access is managed automatically.
/// It's possible to specify explicit execution order between specific systems, /// 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 { pub trait System: Send + Sync + 'static {
/// The system's input. See [`In`](crate::system::In) for /// The system's input. See [`In`](crate::system::In) for
/// [`FunctionSystem`](crate::system::FunctionSystem)s. /// [`FunctionSystem`](crate::system::FunctionSystem)s.
@ -64,8 +64,8 @@ pub trait System: Send + Sync + 'static {
/// Update the system's archetype component [`Access`]. /// Update the system's archetype component [`Access`].
fn update_archetype_component_access(&mut self, world: &World); fn update_archetype_component_access(&mut self, world: &World);
fn check_change_tick(&mut self, change_tick: u32); fn check_change_tick(&mut self, change_tick: u32);
/// Returns the system's default [system sets](crate::schedule_v3::SystemSet). /// Returns the system's default [system sets](crate::schedule::SystemSet).
fn default_system_sets(&self) -> Vec<Box<dyn crate::schedule_v3::SystemSet>> { fn default_system_sets(&self) -> Vec<Box<dyn crate::schedule::SystemSet>> {
Vec::new() Vec::new()
} }
/// Gets the system's last change tick /// Gets the system's last change tick

View File

@ -146,7 +146,7 @@ impl<SystemA: System, SystemB: System<In = SystemA::Out>> System for PipeSystem<
self.system_b.set_last_change_tick(last_change_tick); self.system_b.set_last_change_tick(last_change_tick);
} }
fn default_system_sets(&self) -> Vec<Box<dyn crate::schedule_v3::SystemSet>> { fn default_system_sets(&self) -> Vec<Box<dyn crate::schedule::SystemSet>> {
let mut system_sets = self.system_a.default_system_sets(); let mut system_sets = self.system_a.default_system_sets();
system_sets.extend_from_slice(&self.system_b.default_system_sets()); system_sets.extend_from_slice(&self.system_b.default_system_sets());
system_sets system_sets

View File

@ -20,7 +20,7 @@ use crate::{
event::{Event, Events}, event::{Event, Events},
query::{DebugCheckedUnwrap, QueryState, ReadOnlyWorldQuery, WorldQuery}, query::{DebugCheckedUnwrap, QueryState, ReadOnlyWorldQuery, WorldQuery},
removal_detection::RemovedComponentEvents, removal_detection::RemovedComponentEvents,
schedule_v3::{Schedule, ScheduleLabel, Schedules}, schedule::{Schedule, ScheduleLabel, Schedules},
storage::{Column, ComponentSparseSet, ResourceData, Storages, TableRow}, storage::{Column, ComponentSparseSet, ResourceData, Storages, TableRow},
system::Resource, system::Resource,
}; };
@ -1572,7 +1572,7 @@ impl World {
resources.check_change_ticks(change_tick); resources.check_change_ticks(change_tick);
non_send_resources.check_change_ticks(change_tick); non_send_resources.check_change_ticks(change_tick);
if let Some(mut schedules) = self.get_resource_mut::<crate::schedule_v3::Schedules>() { if let Some(mut schedules) = self.get_resource_mut::<crate::schedule::Schedules>() {
schedules.check_change_ticks(change_tick); schedules.check_change_ticks(change_tick);
} }

View File

@ -5,7 +5,7 @@ use std::hash::Hash;
// unused import, but needed for intra doc link to work // unused import, but needed for intra doc link to work
#[allow(unused_imports)] #[allow(unused_imports)]
use bevy_ecs::schedule_v3::State; use bevy_ecs::schedule::State;
/// A "press-able" input of type `T`. /// 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`] /// 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 /// 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. /// * Using [`Input::clear_just_pressed`] or [`Input::clear_just_released`] instead.
/// * Calling [`Input::clear`] or [`Input::reset`] immediately after the state change. /// * Calling [`Input::clear`] or [`Input::reset`] immediately after the state change.

View File

@ -53,7 +53,7 @@ use crate::{
}; };
use bevy_app::{App, AppLabel, CoreSchedule, Plugin, SubApp}; use bevy_app::{App, AppLabel, CoreSchedule, Plugin, SubApp};
use bevy_asset::{AddAsset, AssetServer}; 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 bevy_utils::tracing::debug;
use std::ops::{Deref, DerefMut}; use std::ops::{Deref, DerefMut};
@ -136,7 +136,7 @@ impl RenderSet {
/// running the next frame while rendering the current frame. /// running the next frame while rendering the current frame.
/// ///
/// This schedule is run on the main world, but its buffers are not applied /// 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)] #[derive(ScheduleLabel, PartialEq, Eq, Debug, Clone, Hash)]
pub struct ExtractSchedule; pub struct ExtractSchedule;

View File

@ -2,7 +2,7 @@ use async_channel::{Receiver, Sender};
use bevy_app::{App, AppLabel, CoreSchedule, Plugin, SubApp}; use bevy_app::{App, AppLabel, CoreSchedule, Plugin, SubApp};
use bevy_ecs::{ use bevy_ecs::{
schedule_v3::MainThreadExecutor, schedule::MainThreadExecutor,
system::Resource, system::Resource,
world::{Mut, World}, world::{Mut, World},
}; };

View File

@ -1,7 +1,7 @@
//! Tools to run systems at a regular interval. //! Tools to run systems at a regular interval.
//! This can be extremely useful for steady, frame-rate independent gameplay logic and physics. //! 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, //! 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. //! via the [`run_fixed_update_schedule`] exclusive system.
//! //!

View File

@ -105,7 +105,7 @@ fn fill_stack_recursively(result: &mut Vec<Entity>, stack: &mut StackingContext)
mod tests { mod tests {
use bevy_ecs::{ use bevy_ecs::{
component::Component, component::Component,
schedule_v3::Schedule, schedule::Schedule,
system::{CommandQueue, Commands}, system::{CommandQueue, Commands},
world::World, world::World,
}; };

View File

@ -13,7 +13,7 @@
//! This example demonstrates how you might detect and resolve (or silence) these ambiguities. //! This example demonstrates how you might detect and resolve (or silence) these ambiguities.
use bevy::{ use bevy::{
ecs::schedule_v3::{LogLevel, ScheduleBuildSettings}, ecs::schedule::{LogLevel, ScheduleBuildSettings},
prelude::*, prelude::*,
}; };