Chess 0.0.1
A library written in c
Loading...
Searching...
No Matches
position_counter.h
Go to the documentation of this file.
1
8#ifndef CHESS_POSITION_COUNTER_H_INCLUDED
9#define CHESS_POSITION_COUNTER_H_INCLUDED
10
11#if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 202311L
12 #include <stdbool.h>
13#endif
14#include <stddef.h>
15#include <stdint.h>
16
21
28 uint64_t key;
29 unsigned int value;
31
43
50
56
62
68
75unsigned int chess_position_counter_count(const ChessPositionCounter *counter, const ChessPosition *position);
76
84
92
93#endif // CHESS_POSITION_COUNTER_H_INCLUDED
void chess_position_counter_clear(ChessPositionCounter *counter)
Clears all entries from the given position counter.
bool chess_position_counter_increment(ChessPositionCounter *counter, const ChessPosition *position)
Increments the count for a given position.
ChessPositionCounter chess_position_counter_new(void)
Creates a new, empty position counter.
bool chess_position_counter_is_valid(const ChessPositionCounter *counter)
Checks if the given position counter is valid.
bool chess_position_counter_decrement(ChessPositionCounter *counter, const ChessPosition *position)
Decrements the count for a given position.
unsigned int chess_position_counter_count(const ChessPositionCounter *counter, const ChessPosition *position)
Gets the count for a given position.
void chess_position_counter_drop(ChessPositionCounter *counter)
Releases resources held by the given position counter.
Entry in the position counter hash table.
Definition position_counter.h:27
unsigned int value
Definition position_counter.h:29
uint64_t key
Definition position_counter.h:28
Hash table for counting chess positions.
Definition position_counter.h:38
size_t size
Definition position_counter.h:40
size_t count
Definition position_counter.h:41
ChessPositionCounterEntry * entries
Definition position_counter.h:39
Represents the position in a chess game.
Definition position.h:30