hasInsufficientMaterial method
Tests if a Side has insufficient winning material.
Implementation
@override
bool hasInsufficientMaterial(Side side) {
if (pockets == null) {
return super.hasInsufficientMaterial(side);
}
return board.occupied.size + pockets!.size <= 3 &&
board.pawns.isEmpty &&
board.promoted.isEmpty &&
board.rooksAndQueens.isEmpty &&
pockets!.count(Role.pawn) <= 0 &&
pockets!.count(Role.rook) <= 0 &&
pockets!.count(Role.queen) <= 0;
}