@@ -747,7 +747,7 @@ fn play_game(mut file_name: &str,
747747 type ComputeMoveOut = LibcZebraOutput ;
748748 type Learn = LibcLearner ;
749749 type FE = LibcFatalError ;
750- type Thor = LegacyThor ;
750+ let thor = LegacyThor ;
751751 let mut play_state: PlayGame < Source > = PlayGame :: new ( file_name, move_string, repeat, move_file, g_state) ;
752752 let mut move_attempt = None ;
753753 let mut total_search_time: f64 = 0. ;
@@ -756,7 +756,7 @@ fn play_game(mut file_name: &str,
756756 let mut stdin_lock = stdin. lock ( ) ;
757757 loop {
758758 let state = next_state :: <
759- ZF , Source , BoardSrc , ComputeMoveLog , ComputeMoveOut , FE , Thor
759+ ZF , Source , BoardSrc , ComputeMoveLog , ComputeMoveOut , FE , LegacyThor
760760 > ( & mut play_state, move_attempt. take ( ) , & LegacyThor ) ;
761761 match state {
762762 // TODO here in all these branches, we should ideally not need mutable reference to play_state
@@ -799,7 +799,7 @@ fn play_game(mut file_name: &str,
799799 dump_position ( play_state. side_to_move , & play_state. g_state . board . board ) ;
800800 dump_game_score ( play_state. side_to_move , play_state. g_state . board . score_sheet_row , & play_state. g_state . board . black_moves , & play_state. g_state . board . white_moves ) ;
801801 /* Check what the Thor opening statistics has to say */
802- Thor :: choose_thor_opening_move ( & play_state. g_state . board . board , play_state. side_to_move , play_state. g_state . config . echo , & mut play_state. g_state . random ) ;
802+ thor . choose_thor_opening_move ( & play_state. g_state . board . board , play_state. side_to_move , play_state. g_state . config . echo , & mut play_state. g_state . random ) ;
803803 }
804804 PlayGameState :: CanLearn => {
805805 if play_state. g_state . config . use_learning && play_state. g_state . config . one_position_only == 0 {
@@ -852,22 +852,22 @@ fn deal_with_thor_1(use_thor_: bool, side_to_move: i32,
852852 mut config : & Config , g_timer : & Timer ,
853853 board_state : & BoardState , total_search_time : & mut f64 ) {
854854 type ZF = LibcFrontend ;
855- type Thor = LegacyThor ;
855+ let thor = LegacyThor ;
856856
857857 if use_thor_ {
858858 let database_start = g_timer. get_real_timer ( ) ;
859- Thor :: database_search ( & board_state. board , side_to_move) ;
860- let thor_position_count = Thor :: get_match_count ( ) ;
859+ thor . database_search ( & board_state. board , side_to_move) ;
860+ let thor_position_count = thor . get_match_count ( ) ;
861861 let database_stop = g_timer. get_real_timer ( ) ;
862862 let database_time = database_stop - database_start;
863863 * total_search_time += database_time;
864864 ZF :: report_thor_matching_games_stats ( * total_search_time, thor_position_count, database_time) ;
865865 if thor_position_count > 0 {
866- let black_win_count = Thor :: get_black_win_count ( ) ;
867- let draw_count = Thor :: get_draw_count ( ) ;
868- let white_win_count = Thor :: get_white_win_count ( ) ;
869- let black_median_score = Thor :: get_black_median_score ( ) ;
870- let black_average_score = Thor :: get_black_average_score ( ) ;
866+ let black_win_count = thor . get_black_win_count ( ) ;
867+ let draw_count = thor . get_draw_count ( ) ;
868+ let white_win_count = thor . get_white_win_count ( ) ;
869+ let black_median_score = thor . get_black_median_score ( ) ;
870+ let black_average_score = thor . get_black_average_score ( ) ;
871871
872872 ZF :: report_thor_stats ( black_win_count, draw_count, white_win_count, black_median_score, black_average_score) ;
873873 }
@@ -879,21 +879,22 @@ fn deal_with_thor_2(use_thor_: bool, side_to_move: i32,
879879 config : & Config , g_timer : & Timer ,
880880 board_state : & BoardState , total_search_time : & mut f64 ) {
881881 type ZF = LibcFrontend ;
882- type Thor = LegacyThor ;
882+ let thor = LegacyThor { } ;
883+ use ThorDatabase ;
883884 if use_thor_ {
884885 let database_start = g_timer. get_real_timer ( ) ;
885- Thor :: database_search ( & board_state. board , side_to_move) ;
886- let thor_position_count = Thor :: get_match_count ( ) ;
886+ thor . database_search ( & board_state. board , side_to_move) ;
887+ let thor_position_count = thor . get_match_count ( ) ;
887888 let database_stop = g_timer. get_real_timer ( ) ;
888889 let db_search_time = database_stop - database_start;
889890 * total_search_time += db_search_time;
890891 ZF :: report_some_thor_stats ( * total_search_time, thor_position_count, db_search_time) ;
891892 if thor_position_count > 0 {
892- let black_win_count = Thor :: get_black_win_count ( ) ;
893- let draw_count = Thor :: get_draw_count ( ) ;
894- let white_win_count = Thor :: get_white_win_count ( ) ;
895- let black_median_score = Thor :: get_black_median_score ( ) ;
896- let black_average_score = Thor :: get_black_average_score ( ) ;
893+ let black_win_count = thor . get_black_win_count ( ) ;
894+ let draw_count = thor . get_draw_count ( ) ;
895+ let white_win_count = thor . get_white_win_count ( ) ;
896+ let black_median_score = thor . get_black_median_score ( ) ;
897+ let black_average_score = thor . get_black_average_score ( ) ;
897898 ZF :: report_some_thor_scores ( black_win_count, draw_count, white_win_count, black_median_score, black_average_score) ;
898899 }
899900 ZF :: print_out_thor_matches ( config. thor_max_games ) ;
0 commit comments