@@ -567,66 +567,67 @@ void AutoStory::test_checkpoints(
567567 int start, int end,
568568 int loop, int start_loop, int end_loop
569569){
570+ AutoStoryStats& stats = env.current_stats <AutoStoryStats>();
570571 EventNotificationOption& notif_status_update = NOTIFICATION_STATUS_UPDATE;
571572 Language language = LANGUAGE;
572573 StarterChoice starter_choice = STARTERCHOICE;
573574 std::vector<std::function<void ()>> checkpoint_list;
574575 checkpoint_list.push_back ([&](){checkpoint_00 (env, context);});
575- checkpoint_list.push_back ([&](){checkpoint_01 (env, context, notif_status_update, language);});
576- checkpoint_list.push_back ([&](){checkpoint_02 (env, context, notif_status_update);});
577- checkpoint_list.push_back ([&](){checkpoint_03 (env, context, notif_status_update, language, starter_choice);});
578- checkpoint_list.push_back ([&](){checkpoint_04 (env, context, notif_status_update);});
579- checkpoint_list.push_back ([&](){checkpoint_05 (env, context, notif_status_update);});
580- checkpoint_list.push_back ([&](){checkpoint_06 (env, context, notif_status_update);});
581- checkpoint_list.push_back ([&](){checkpoint_07 (env, context, notif_status_update);});
582- checkpoint_list.push_back ([&](){checkpoint_08 (env, context, notif_status_update);});
583- checkpoint_list.push_back ([&](){checkpoint_09 (env, context, notif_status_update);});
584- checkpoint_list.push_back ([&](){checkpoint_10 (env, context, notif_status_update);});
585- checkpoint_list.push_back ([&](){checkpoint_11 (env, context, notif_status_update);});
586- checkpoint_list.push_back ([&](){checkpoint_12 (env, context, notif_status_update);});
587- checkpoint_list.push_back ([&](){checkpoint_13 (env, context, notif_status_update);});
588- checkpoint_list.push_back ([&](){checkpoint_14 (env, context, notif_status_update);});
589- checkpoint_list.push_back ([&](){checkpoint_15 (env, context, notif_status_update);});
590- checkpoint_list.push_back ([&](){checkpoint_16 (env, context, notif_status_update);});
591- checkpoint_list.push_back ([&](){checkpoint_17 (env, context, notif_status_update);});
592- checkpoint_list.push_back ([&](){checkpoint_18 (env, context, notif_status_update);});
593- checkpoint_list.push_back ([&](){checkpoint_19 (env, context, notif_status_update);});
594- checkpoint_list.push_back ([&](){checkpoint_20 (env, context, notif_status_update);});
595- checkpoint_list.push_back ([&](){checkpoint_21 (env, context, notif_status_update);});
596- checkpoint_list.push_back ([&](){checkpoint_22 (env, context, notif_status_update);});
597- checkpoint_list.push_back ([&](){checkpoint_23 (env, context, notif_status_update);});
598- checkpoint_list.push_back ([&](){checkpoint_24 (env, context, notif_status_update);});
599- checkpoint_list.push_back ([&](){checkpoint_25 (env, context, notif_status_update);});
600- checkpoint_list.push_back ([&](){checkpoint_26 (env, context, notif_status_update);});
601- checkpoint_list.push_back ([&](){checkpoint_27 (env, context, notif_status_update);});
602- checkpoint_list.push_back ([&](){checkpoint_28 (env, context, notif_status_update);});
603- checkpoint_list.push_back ([&](){checkpoint_29 (env, context, notif_status_update);});
604- checkpoint_list.push_back ([&](){checkpoint_30 (env, context, notif_status_update);});
605- checkpoint_list.push_back ([&](){checkpoint_31 (env, context, notif_status_update);});
606- checkpoint_list.push_back ([&](){checkpoint_32 (env, context, notif_status_update);});
607- checkpoint_list.push_back ([&](){checkpoint_33 (env, context, notif_status_update);});
608- checkpoint_list.push_back ([&](){checkpoint_34 (env, context, notif_status_update);});
609- checkpoint_list.push_back ([&](){checkpoint_35 (env, context, notif_status_update);});
610- checkpoint_list.push_back ([&](){checkpoint_36 (env, context, notif_status_update);});
611- checkpoint_list.push_back ([&](){checkpoint_37 (env, context, notif_status_update);});
612- checkpoint_list.push_back ([&](){checkpoint_38 (env, context, notif_status_update);});
613- checkpoint_list.push_back ([&](){checkpoint_39 (env, context, notif_status_update);});
614- checkpoint_list.push_back ([&](){checkpoint_40 (env, context, notif_status_update);});
615- checkpoint_list.push_back ([&](){checkpoint_41 (env, context, notif_status_update);});
616- checkpoint_list.push_back ([&](){checkpoint_42 (env, context, notif_status_update);});
617- checkpoint_list.push_back ([&](){checkpoint_43 (env, context, notif_status_update);});
618- checkpoint_list.push_back ([&](){checkpoint_44 (env, context, notif_status_update);});
619- checkpoint_list.push_back ([&](){checkpoint_45 (env, context, notif_status_update);});
620- checkpoint_list.push_back ([&](){checkpoint_46 (env, context, notif_status_update);});
621- checkpoint_list.push_back ([&](){checkpoint_47 (env, context, notif_status_update);});
622- checkpoint_list.push_back ([&](){checkpoint_48 (env, context, notif_status_update);});
623- checkpoint_list.push_back ([&](){checkpoint_49 (env, context, notif_status_update);});
624- checkpoint_list.push_back ([&](){checkpoint_50 (env, context, notif_status_update);});
625- checkpoint_list.push_back ([&](){checkpoint_51 (env, context, notif_status_update);});
626- checkpoint_list.push_back ([&](){checkpoint_52 (env, context, notif_status_update);});
627- checkpoint_list.push_back ([&](){checkpoint_53 (env, context, notif_status_update);});
628- checkpoint_list.push_back ([&](){checkpoint_54 (env, context, notif_status_update);});
629- checkpoint_list.push_back ([&](){checkpoint_55 (env, context, notif_status_update);});
576+ checkpoint_list.push_back ([&](){checkpoint_01 (env, context, notif_status_update, stats, language);});
577+ checkpoint_list.push_back ([&](){checkpoint_02 (env, context, notif_status_update, stats );});
578+ checkpoint_list.push_back ([&](){checkpoint_03 (env, context, notif_status_update, stats, language, starter_choice);});
579+ checkpoint_list.push_back ([&](){checkpoint_04 (env, context, notif_status_update, stats );});
580+ checkpoint_list.push_back ([&](){checkpoint_05 (env, context, notif_status_update, stats );});
581+ checkpoint_list.push_back ([&](){checkpoint_06 (env, context, notif_status_update, stats );});
582+ checkpoint_list.push_back ([&](){checkpoint_07 (env, context, notif_status_update, stats );});
583+ checkpoint_list.push_back ([&](){checkpoint_08 (env, context, notif_status_update, stats );});
584+ checkpoint_list.push_back ([&](){checkpoint_09 (env, context, notif_status_update, stats );});
585+ checkpoint_list.push_back ([&](){checkpoint_10 (env, context, notif_status_update, stats );});
586+ checkpoint_list.push_back ([&](){checkpoint_11 (env, context, notif_status_update, stats );});
587+ checkpoint_list.push_back ([&](){checkpoint_12 (env, context, notif_status_update, stats );});
588+ checkpoint_list.push_back ([&](){checkpoint_13 (env, context, notif_status_update, stats );});
589+ checkpoint_list.push_back ([&](){checkpoint_14 (env, context, notif_status_update, stats );});
590+ checkpoint_list.push_back ([&](){checkpoint_15 (env, context, notif_status_update, stats );});
591+ checkpoint_list.push_back ([&](){checkpoint_16 (env, context, notif_status_update, stats );});
592+ checkpoint_list.push_back ([&](){checkpoint_17 (env, context, notif_status_update, stats );});
593+ checkpoint_list.push_back ([&](){checkpoint_18 (env, context, notif_status_update, stats );});
594+ checkpoint_list.push_back ([&](){checkpoint_19 (env, context, notif_status_update, stats );});
595+ checkpoint_list.push_back ([&](){checkpoint_20 (env, context, notif_status_update, stats );});
596+ checkpoint_list.push_back ([&](){checkpoint_21 (env, context, notif_status_update, stats );});
597+ checkpoint_list.push_back ([&](){checkpoint_22 (env, context, notif_status_update, stats );});
598+ checkpoint_list.push_back ([&](){checkpoint_23 (env, context, notif_status_update, stats );});
599+ checkpoint_list.push_back ([&](){checkpoint_24 (env, context, notif_status_update, stats );});
600+ checkpoint_list.push_back ([&](){checkpoint_25 (env, context, notif_status_update, stats );});
601+ checkpoint_list.push_back ([&](){checkpoint_26 (env, context, notif_status_update, stats );});
602+ checkpoint_list.push_back ([&](){checkpoint_27 (env, context, notif_status_update, stats );});
603+ checkpoint_list.push_back ([&](){checkpoint_28 (env, context, notif_status_update, stats );});
604+ checkpoint_list.push_back ([&](){checkpoint_29 (env, context, notif_status_update, stats );});
605+ checkpoint_list.push_back ([&](){checkpoint_30 (env, context, notif_status_update, stats );});
606+ checkpoint_list.push_back ([&](){checkpoint_31 (env, context, notif_status_update, stats );});
607+ checkpoint_list.push_back ([&](){checkpoint_32 (env, context, notif_status_update, stats );});
608+ checkpoint_list.push_back ([&](){checkpoint_33 (env, context, notif_status_update, stats );});
609+ checkpoint_list.push_back ([&](){checkpoint_34 (env, context, notif_status_update, stats );});
610+ checkpoint_list.push_back ([&](){checkpoint_35 (env, context, notif_status_update, stats );});
611+ checkpoint_list.push_back ([&](){checkpoint_36 (env, context, notif_status_update, stats );});
612+ checkpoint_list.push_back ([&](){checkpoint_37 (env, context, notif_status_update, stats );});
613+ checkpoint_list.push_back ([&](){checkpoint_38 (env, context, notif_status_update, stats );});
614+ checkpoint_list.push_back ([&](){checkpoint_39 (env, context, notif_status_update, stats );});
615+ checkpoint_list.push_back ([&](){checkpoint_40 (env, context, notif_status_update, stats );});
616+ checkpoint_list.push_back ([&](){checkpoint_41 (env, context, notif_status_update, stats );});
617+ checkpoint_list.push_back ([&](){checkpoint_42 (env, context, notif_status_update, stats );});
618+ checkpoint_list.push_back ([&](){checkpoint_43 (env, context, notif_status_update, stats );});
619+ checkpoint_list.push_back ([&](){checkpoint_44 (env, context, notif_status_update, stats );});
620+ checkpoint_list.push_back ([&](){checkpoint_45 (env, context, notif_status_update, stats );});
621+ checkpoint_list.push_back ([&](){checkpoint_46 (env, context, notif_status_update, stats );});
622+ checkpoint_list.push_back ([&](){checkpoint_47 (env, context, notif_status_update, stats );});
623+ checkpoint_list.push_back ([&](){checkpoint_48 (env, context, notif_status_update, stats );});
624+ checkpoint_list.push_back ([&](){checkpoint_49 (env, context, notif_status_update, stats );});
625+ checkpoint_list.push_back ([&](){checkpoint_50 (env, context, notif_status_update, stats );});
626+ checkpoint_list.push_back ([&](){checkpoint_51 (env, context, notif_status_update, stats );});
627+ checkpoint_list.push_back ([&](){checkpoint_52 (env, context, notif_status_update, stats );});
628+ checkpoint_list.push_back ([&](){checkpoint_53 (env, context, notif_status_update, stats );});
629+ checkpoint_list.push_back ([&](){checkpoint_54 (env, context, notif_status_update, stats );});
630+ checkpoint_list.push_back ([&](){checkpoint_55 (env, context, notif_status_update, stats );});
630631
631632
632633 for (int checkpoint = start; checkpoint <= end; checkpoint++){
@@ -728,12 +729,13 @@ void AutoStory::run_autostory(SingleSwitchProgramEnvironment& env, ProController
728729 NOTIFICATION_STATUS_UPDATE
729730 };
730731
732+ AutoStoryStats& stats = env.current_stats <AutoStoryStats>();
731733 if (get_start_segment_index () > get_end_segment_index ()){
732734 throw UserSetupError (env.logger (), " The start segment cannot be later than the end segment." );
733735 }
734-
736+
735737 for (size_t segment_index = get_start_segment_index (); segment_index <= get_end_segment_index (); segment_index++){
736- ALL_AUTO_STORY_SEGMENT_LIST ()[segment_index]->run_segment (env, context, options);
738+ ALL_AUTO_STORY_SEGMENT_LIST ()[segment_index]->run_segment (env, context, options, stats );
737739 }
738740}
739741
@@ -797,7 +799,6 @@ void AutoStory::test_code(SingleSwitchProgramEnvironment& env, ProControllerCont
797799
798800void AutoStory::program (SingleSwitchProgramEnvironment& env, ProControllerContext& context){
799801 assert_16_9_720p_min (env.logger (), env.console );
800- // AutoStoryStats& stats = env.current_stats<AutoStoryStats>();
801802
802803
803804 // test code
0 commit comments