Fixed-capacity priority queue tailored for Connect-4 move ordering. More...
#include <MoveList.h>
Public Types | |
| using | TBitBoard = uint64_t |
| 64-bit bitboard type (mirrors the alias defined in Board.h). | |
Public Member Functions | |
| void | insert (const TBitBoard move, const int score) |
| Insert a (move, score) pair while keeping the queue sorted. | |
| TBitBoard | pop () |
| Remove and return the highest-priority move. | |
| unsigned int | getSize () const |
| Number of moves currently stored. | |
| void | reset () |
| Empty the queue without freeing any memory. | |
| MoveList () | |
| Construct an empty move list. | |
Static Public Attributes | |
| static constexpr int | N_COLUMNS = 7 |
| Maximum number of moves the queue can hold. | |
Fixed-capacity priority queue tailored for Connect-4 move ordering.
The queue holds at most N_COLUMNS entries (one per column) using a stack-allocated array. insert() performs an insertion sort by ascending score so that pop() can return the highest-scoring entry in O(1). When two entries share the same score the FIFO order of insertion is preserved.
Definition at line 24 of file MoveList.h.
| using BitBully::MoveList::TBitBoard = uint64_t |
64-bit bitboard type (mirrors the alias defined in Board.h).
Definition at line 28 of file MoveList.h.
|
inline |
Construct an empty move list.
Definition at line 62 of file MoveList.h.
|
inline |
Number of moves currently stored.
Definition at line 56 of file MoveList.h.
|
inline |
Insert a (move, score) pair while keeping the queue sorted.
| move | Bitboard with exactly one bit representing the move. |
| score | Priority score; higher values are popped first. |
Definition at line 39 of file MoveList.h.
|
inline |
Remove and return the highest-priority move.
0 if the queue is empty. Definition at line 51 of file MoveList.h.
|
inline |
Empty the queue without freeing any memory.
Definition at line 59 of file MoveList.h.
| TBitBoard BitBully::MoveList::move |
Single-bit move mask.
Definition at line 75 of file MoveList.h.
|
staticconstexpr |
Maximum number of moves the queue can hold.
Definition at line 32 of file MoveList.h.
| int BitBully::MoveList::score |
Priority score.
Definition at line 76 of file MoveList.h.