51 lines
1.6 KiB
C
51 lines
1.6 KiB
C
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* best_move_inner.h :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2024/01/29 21:31:42 by maiboyer #+# #+# */
|
|
/* Updated: 2024/01/31 14:12:25 by maiboyer ### ########.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
#ifndef BEST_MOVE_INNER_H
|
|
#define BEST_MOVE_INNER_H
|
|
|
|
#include "app/best_move.h"
|
|
#include "app/rotate.h"
|
|
#include "app/state.h"
|
|
#include "me/types.h"
|
|
#include "me/vec/vec_i64.h"
|
|
|
|
typedef void (*t_banana_func)(void *);
|
|
typedef t_usize (*t_iter_pos_func)(t_vec_i64 *);
|
|
|
|
enum e_best_move_stack_selector
|
|
{
|
|
MAIN,
|
|
OTHER,
|
|
BOTH,
|
|
};
|
|
|
|
typedef struct s_best_move_args_but_better
|
|
{
|
|
t_best_move_args data;
|
|
t_vec_i64 *main_stack;
|
|
t_vec_i64 *other_stack;
|
|
t_iter_pos_func iter_func;
|
|
|
|
} t_best_move_args_but_better;
|
|
|
|
static inline t_banana_func choose_func(struct s_functions *funcs,
|
|
t_rotation rotate)
|
|
{
|
|
if (rotate.direction == FORWARD)
|
|
return (funcs->forward);
|
|
else if (rotate.direction == REVERSE)
|
|
return (funcs->reverse);
|
|
return (NULL);
|
|
}
|
|
|
|
#endif /* BEST_MOVE_INNER_H */
|