GDHXEMN5IXJDS63G3DUZH5PR2XH2SSXISABF2JHCYA3JSRXDPLMQC
occupancies: [@typeInfo(Chess.Colors).Enum.fields.len]BoardType = [_]BoardType{0} ** 2,
occupancies: [@typeInfo(Chess.Colors).Enum.fields.len]BitBoard = blk: {
var bbs: [2]BitBoard = undefined;
for (bbs) |*bb| {
bb.* = BitBoard{};
}
break :blk bbs;
},
return self.occupancies[@enumToInt(Chess.Colors.white)] |
self.occupancies[@enumToInt(Chess.Colors.black)];
return @bitCast(BoardType, self.occupancies[@enumToInt(Chess.Colors.white)]) |
@bitCast(BoardType, self.occupancies[@enumToInt(Chess.Colors.black)]);
// handle occupancy arrays
{
// remove source target, one of them is no-op
self.occupancies[@enumToInt(Chess.Colors.white)].unSet(move.source);
self.occupancies[@enumToInt(Chess.Colors.black)].unSet(move.source);
// set target for the proper side
switch (self.side) {
.white => {
self.occupancies[@enumToInt(Chess.Colors.white)].set(move.target);
self.occupancies[@enumToInt(Chess.Colors.black)].unSet(move.target);
},
.black => {
self.occupancies[@enumToInt(Chess.Colors.black)].set(move.target);
self.occupancies[@enumToInt(Chess.Colors.white)].unSet(move.target);
},
}
}