From 9c3373731420890f73ffa044939a1a48457b64c4 Mon Sep 17 00:00:00 2001 From: Shlomi Fish Date: Sun, 7 Apr 2024 06:44:01 +0300 Subject: [PATCH] Disable/hide the animated/graphic solution display if the game-variant rules do not match 8cols+4reserves freecell --- fc-solve/scripts/Makefile.to-javascript.mak | 3 ++ fc-solve/source/lib.c | 34 +++++++++++++++++++++ 2 files changed, 37 insertions(+) diff --git a/fc-solve/scripts/Makefile.to-javascript.mak b/fc-solve/scripts/Makefile.to-javascript.mak index ceaad4463..473f5161f 100644 --- a/fc-solve/scripts/Makefile.to-javascript.mak +++ b/fc-solve/scripts/Makefile.to-javascript.mak @@ -104,10 +104,13 @@ NEEDED_FUNCTIONS = \ freecell_solver_user_cmd_line_read_cmd_line_preset \ freecell_solver_user_current_state_stringify \ freecell_solver_user_free \ + freecell_solver_user_get_empty_stacks_filled_by \ freecell_solver_user_get_invalid_state_error_into_string \ freecell_solver_user_get_next_move \ freecell_solver_user_get_num_freecells \ freecell_solver_user_get_num_stacks \ + freecell_solver_user_get_sequence_move \ + freecell_solver_user_get_sequences_are_built_by_type \ freecell_solver_user_get_unrecognized_cmd_line_flag \ freecell_solver_user_get_unrecognized_cmd_line_flag_status \ freecell_solver_user_limit_iterations_long \ diff --git a/fc-solve/source/lib.c b/fc-solve/source/lib.c index 322a328d4..934fece70 100644 --- a/fc-solve/source/lib.c +++ b/fc-solve/source/lib.c @@ -4011,6 +4011,17 @@ int DLLEXPORT freecell_solver_user_set_sequences_are_built_by_type( return 0; } + +#ifdef FC_SOLVE_JAVASCRIPT_QUERYING +int DLLEXPORT freecell_solver_user_get_sequences_are_built_by_type( + void *const api_instance) +{ + return ((((fcs_user *const)api_instance) + ->common_preset.game_params.game_flags) & + 0x3); +} +#endif + #endif #ifndef FCS_FREECELL_ONLY @@ -4026,6 +4037,17 @@ int DLLEXPORT freecell_solver_user_set_sequence_move( apply_game_params_for_all_instances(user); return 0; } + +#ifdef FC_SOLVE_JAVASCRIPT_QUERYING +int DLLEXPORT freecell_solver_user_get_sequence_move(void *const api_instance) +{ + return (((((fcs_user *const)api_instance) + ->common_preset.game_params.game_flags) >> + 4) & + 0x1); +} +#endif + #endif #ifndef FCS_FREECELL_ONLY @@ -4043,6 +4065,18 @@ int DLLEXPORT freecell_solver_user_set_empty_stacks_filled_by( apply_game_params_for_all_instances(user); return 0; } + +#ifdef FC_SOLVE_JAVASCRIPT_QUERYING +int DLLEXPORT freecell_solver_user_get_empty_stacks_filled_by( + void *const api_instance) +{ + return (((((fcs_user *const)api_instance) + ->common_preset.game_params.game_flags) >> + 2) & + 0x3); +} +#endif + #endif int DLLEXPORT freecell_solver_user_set_a_star_weight(