#ifndef PV_H_INCLUDED
#define PV_H_INCLUDED

#include "move.h"
#include "eval.h"
#include "position.h"

#define PV_PLY_MAX 31

// the pv data type
typedef struct {
    MOVE mv[PV_PLY_MAX][PV_PLY_MAX];
    EVAL scr[PV_PLY_MAX];
} PV;

// clear the current sub-line
void pv_clear(PV* pv, int ply);

// save the current best sub-line
void pv_save(PV* pv, int ply, MOVE mv, EVAL scr);

// best move and score getters
MOVE pv_get_mv(const PV* pv, int ply);
EVAL pv_get_scr(const PV* pv, int ply);

// input/output in UCI format
void pv_print_uci(char* uci, const PV* pv, POSITION pos, int c960);
void pv_print_uci_best(char* uci, const PV* pv, POSITION pos, int c960);

// test the functions above
int pv_test();

#endif // PV_H_INCLUDED
