From c1a4a2f6c50f1879b57be281af18399d8d17757b Mon Sep 17 00:00:00 2001 From: Daniel McNab <36049421+DJMcNab@users.noreply.github.com> Date: Fri, 25 Feb 2022 03:10:59 +0000 Subject: [PATCH] Remove the config api (#3633) # Objective - Fix the ugliness of the `config` api. - Supercedes #2440, #2463, #2491 ## Solution - Since #2398, capturing closure systems have worked. - Use those instead where we needed config before - Remove the rest of the config api. - Related: #2777 --- crates/bevy_core/src/time/fixed_timestep.rs | 33 ++-- crates/bevy_ecs/macros/src/lib.rs | 14 +- crates/bevy_ecs/src/lib.rs | 4 +- crates/bevy_ecs/src/schedule/state.rs | 84 +++++---- crates/bevy_ecs/src/system/function_system.rs | 74 +------- crates/bevy_ecs/src/system/mod.rs | 19 +- crates/bevy_ecs/src/system/system_param.rs | 163 +++++------------- 7 files changed, 107 insertions(+), 284 deletions(-) diff --git a/crates/bevy_core/src/time/fixed_timestep.rs b/crates/bevy_core/src/time/fixed_timestep.rs index bd3384d4ca..fa39ced311 100644 --- a/crates/bevy_core/src/time/fixed_timestep.rs +++ b/crates/bevy_core/src/time/fixed_timestep.rs @@ -4,7 +4,7 @@ use bevy_ecs::{ component::ComponentId, query::Access, schedule::ShouldRun, - system::{ConfigurableSystem, IntoSystem, Local, Res, ResMut, System}, + system::{IntoSystem, Res, ResMut, System}, world::World, }; use bevy_utils::HashMap; @@ -79,7 +79,9 @@ impl Default for FixedTimestep { fn default() -> Self { Self { state: LocalFixedTimestepState::default(), - internal_system: Box::new(IntoSystem::into_system(Self::prepare_system)), + internal_system: Box::new(IntoSystem::into_system(Self::prepare_system( + Default::default(), + ))), } } } @@ -116,18 +118,18 @@ impl FixedTimestep { } fn prepare_system( - mut state: Local, - time: Res