Open TomaszJaworski777 opened 1 year ago
The result is cached (the init function is called, which granted it probably shouldn’t be, but it does exit immediately if the initialization step has already been done). I agree it would have been good to expose the underlying bitboard, but as of Aug 1 I’m no longer making changes to the API.
.SquareIsAttackedByOpponent() generates the mask of attacks everytime you call it, which is slow, which creates a problem. There should be a way to cache an attack mask and use it in the same position for performance.
I would like to have public mathod .GetAttackMask() that basically returns the mask and allows me to call BitboardHelper.SquareIsSet(moveGen.GetOpponentAttackMap(board), square);
This function already exists, but its hidden in APIMoveGen, just make it public.