@@ -917,68 +917,6 @@ impl World {
917917 column. check_change_ticks ( change_tick) ;
918918 }
919919 }
920-
921- /// Runs a system in a blocking fashion on the `World`
922- ///
923- /// Use [System::run_unsafe] directly for manual unsafe execution
924- /// of simultaneous systems in parallel.
925- ///
926- /// The `system` parameter here can be any function
927- /// that could be added as a system to a standard `App`.
928- ///
929- /// # Examples
930- ///
931- /// Here's an example of how to directly run an ordinary parallel system.
932- /// ```rust
933- /// use bevy_ecs::prelude::*;
934- ///
935- /// struct Counter(u8);
936- /// let mut world = World::new();
937- ///
938- /// fn count_up(mut counter: ResMut<Counter>){
939- /// counter.0 += 1;
940- /// }
941- ///
942- /// world.insert_resource::<Counter>(Counter(0));
943- /// world.run_system(count_up);
944- /// let counter = world.get_resource::<Counter>().unwrap();
945- /// assert_eq!(counter.0, 1);
946- /// ```
947- /// And here's how you directly run an exclusive system.
948- /// ```rust
949- /// use bevy_ecs::prelude::*;
950- ///
951- /// struct Counter(u8);
952- /// let mut world = World::new();
953- ///
954- /// fn count_up_exclusive(world: &mut World){
955- /// let mut counter = world.get_resource_mut::<Counter>().unwrap();
956- /// counter.0 += 1;
957- /// }
958- ///
959- /// world.insert_resource::<Counter>(Counter(0));
960- /// world.run_system(count_up_exclusive.exclusive_system());
961- /// let counter = world.get_resource::<Counter>().unwrap();
962- /// assert_eq!(counter.0, 1);
963- /// ```
964- pub fn run_system < Params > ( & mut self , system : impl IntoSystemDescriptor < Params > ) {
965- let system_descriptor: SystemDescriptor = system. into_descriptor ( ) ;
966-
967- match system_descriptor {
968- SystemDescriptor :: Parallel ( par_system_descriptor) => {
969- let mut boxed_system = par_system_descriptor. system ;
970- boxed_system. initialize ( self ) ;
971- boxed_system. run ( ( ) , self ) ;
972- // Immediately flushes any Commands or similar buffers created
973- boxed_system. apply_buffers ( self ) ;
974- }
975- SystemDescriptor :: Exclusive ( exc_system_descriptor) => {
976- let mut boxed_system = exc_system_descriptor. system ;
977- boxed_system. initialize ( self ) ;
978- boxed_system. run ( self ) ;
979- }
980- }
981- }
982920}
983921
984922impl fmt:: Debug for World {
0 commit comments