#ifndef STATS_H_INCLUDED
#define STATS_H_INCLUDED

#include "ramjet.h"
#include "move.h"
#include "position.h"

// the statistics data type
typedef struct {
    MILLISEC start;
    NODECOUNT nodes;
    int depth;
    MOVE curr_mv;
    int curr_n;
    NODECOUNT stint_ref;
    NODECOUNT stint_len;
} STATS;

// reset the statistics to their initial values
void stat_clear(STATS* stat);

// increment the counters
void stat_nodes_inc(STATS* stat);
void stat_depth_inc(STATS* stat);

// set the current move
void stat_set_curr_mv(STATS* stat, MOVE mv, int n);

// manage the stint counters
void stat_set_stint_ref(STATS* stat);
void stat_double_stint_len(STATS* stat);
int is_stint_over(STATS* stat);

// input/output in UCI format
void stat_print_uci_speed(char* uci, const STATS* stat);
void stat_print_uci_depth(char* uci, const STATS* stat);
void stat_print_uci_curr_mv(char* uci, const STATS* stat, const POSITION* pos, int c960);

#endif // STATS_H_INCLUDED
