I am currently developing a Bitboard chess engine using C++. I am in the process of creating the move generator function. I have completed most of it and only the casting part is left.
I have used Magic Bitboards for sliding pieces and precalculated the attacks for other pieces. I am trying to make everything Highly efficient, by avoiding too many if-statements. The part I am stuck at is castling. The most naive method would be to use a few if-statements for checking whether the squares are empty and castling is still available. But this wouldn't be efficient at all.
What would be the fastest method to generate castle-moves?