Remove .system()
(#4499)
Free at last! # Objective - Using `.system()` is no longer needed anywhere, and anyone using it will have already gotten a deprecation warning. - https://github.com/bevyengine/bevy/pull/3302 was a super special case for `.system()`, since it was so prevelant. However, that's no reason. - Despite it being deprecated, another couple of uses of it have already landed, including in the deprecating PR. - These have all been because of doc examples having warnings not breaking CI - 🎟️? ## Solution - Remove it. - It's gone --- ## Changelog - You can no longer use `.system()` ## Migration Guide - You can no longer use `.system()`. It was deprecated in 0.7.0, and you should have followed the deprecation warning then. You can just remove the method call.  - Thanks to the @TheRawMeatball for producing
This commit is contained in:
parent
af63d4048a
commit
639fec20d6
@ -284,10 +284,10 @@ impl<'w, 's> Commands<'w, 's> {
|
|||||||
/// # high_score: u32,
|
/// # high_score: u32,
|
||||||
/// # }
|
/// # }
|
||||||
/// #
|
/// #
|
||||||
/// # fn system(mut commands: Commands) {
|
/// # fn initialise_scoreboard(mut commands: Commands) {
|
||||||
/// commands.init_resource::<Scoreboard>();
|
/// commands.init_resource::<Scoreboard>();
|
||||||
/// # }
|
/// # }
|
||||||
/// # system.system();
|
/// # bevy_ecs::system::assert_is_system(initialise_scoreboard);
|
||||||
/// ```
|
/// ```
|
||||||
pub fn init_resource<R: Resource + FromWorld>(&mut self) {
|
pub fn init_resource<R: Resource + FromWorld>(&mut self) {
|
||||||
self.queue.push(InitResource::<R> {
|
self.queue.push(InitResource::<R> {
|
||||||
|
@ -249,7 +249,7 @@ impl<Param: SystemParam> FromWorld for SystemState<Param> {
|
|||||||
///
|
///
|
||||||
/// fn my_system_function(an_usize_resource: Res<usize>) {}
|
/// fn my_system_function(an_usize_resource: Res<usize>) {}
|
||||||
///
|
///
|
||||||
/// let system = IntoSystem::system(my_system_function);
|
/// let system = IntoSystem::into_system(my_system_function);
|
||||||
/// ```
|
/// ```
|
||||||
// This trait has to be generic because we have potentially overlapping impls, in particular
|
// This trait has to be generic because we have potentially overlapping impls, in particular
|
||||||
// because Rust thinks a type could impl multiple different `FnMut` combinations
|
// because Rust thinks a type could impl multiple different `FnMut` combinations
|
||||||
@ -257,26 +257,6 @@ impl<Param: SystemParam> FromWorld for SystemState<Param> {
|
|||||||
pub trait IntoSystem<In, Out, Params>: Sized {
|
pub trait IntoSystem<In, Out, Params>: Sized {
|
||||||
type System: System<In = In, Out = Out>;
|
type System: System<In = In, Out = Out>;
|
||||||
/// Turns this value into its corresponding [`System`].
|
/// Turns this value into its corresponding [`System`].
|
||||||
///
|
|
||||||
/// Use of this method was formerly required whenever adding a `system` to an `App`.
|
|
||||||
/// or other cases where a system is required.
|
|
||||||
/// However, since [#2398](https://github.com/bevyengine/bevy/pull/2398),
|
|
||||||
/// this is no longer required.
|
|
||||||
///
|
|
||||||
/// In future, this method will be removed.
|
|
||||||
///
|
|
||||||
/// One use of this method is to assert that a given function is a valid system.
|
|
||||||
/// For this case, use [`bevy_ecs::system::assert_is_system`] instead.
|
|
||||||
///
|
|
||||||
/// [`bevy_ecs::system::assert_is_system`]: [`crate::system::assert_is_system`]:
|
|
||||||
#[deprecated(
|
|
||||||
since = "0.7.0",
|
|
||||||
note = "`.system()` is no longer needed, as methods which accept systems will convert functions into a system automatically"
|
|
||||||
)]
|
|
||||||
fn system(self) -> Self::System {
|
|
||||||
IntoSystem::into_system(self)
|
|
||||||
}
|
|
||||||
/// Turns this value into its corresponding [`System`].
|
|
||||||
fn into_system(this: Self) -> Self::System;
|
fn into_system(this: Self) -> Self::System;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -322,7 +302,7 @@ pub struct InputMarker;
|
|||||||
|
|
||||||
/// The [`System`] counter part of an ordinary function.
|
/// The [`System`] counter part of an ordinary function.
|
||||||
///
|
///
|
||||||
/// You get this by calling [`IntoSystem::system`] on a function that only accepts
|
/// You get this by calling [`IntoSystem::into_system`] on a function that only accepts
|
||||||
/// [`SystemParam`]s. The output of the system becomes the functions return type, while the input
|
/// [`SystemParam`]s. The output of the system becomes the functions return type, while the input
|
||||||
/// becomes the functions [`In`] tagged parameter or `()` if no such parameter exists.
|
/// becomes the functions [`In`] tagged parameter or `()` if no such parameter exists.
|
||||||
pub struct FunctionSystem<In, Out, Param, Marker, F>
|
pub struct FunctionSystem<In, Out, Param, Marker, F>
|
||||||
|
@ -1138,7 +1138,7 @@ where
|
|||||||
/// println!("Bam!")
|
/// println!("Bam!")
|
||||||
/// }
|
/// }
|
||||||
/// }
|
/// }
|
||||||
/// # targeting_system.system();
|
/// # bevy_ecs::system::assert_is_system(targeting_system);
|
||||||
/// ```
|
/// ```
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn contains(&self, entity: Entity) -> bool {
|
pub fn contains(&self, entity: Entity) -> bool {
|
||||||
|
Loading…
Reference in New Issue
Block a user