nkarve / surge

A fast bitboard-based chess move generator in C++
MIT License
63 stars 15 forks source link

How to get around need for constant in MoveList creation #25

Open aaronbanse opened 1 year ago

aaronbanse commented 1 year ago

When I create a MoveList, it seems like you can't have an expression for the color, you just need to specify a constant WHITE or BLACK. Currently, this means that I can't switch between which color I'm generating moves for at runtime with just one MoveList. I would have to separately make a WHITE and BLACK MoveList every time I want to access it, since creating a MoveList requires the color as a constant.

How do I get around this, am I missing something? I'm not super experienced with C++ and haven't worked withe templates before.

Thibor commented 1 year ago

i got this same problem even worst i got acces only for first and last move in move list, and side_to_play is private after put fen no access to it, i need smoe exaples how to use this stuff.

Thibor commented 1 year ago

i resolve it making public list in MoveList and side_to_play in Position now i got access to movelsit and side