I suppose this would be easier to implement, at least at the level of pseudo-legal moves. A piece could have not a single, but a set of move descriptions (e.g. specified by a comma-separated list of XBetza notations). And the move generator would fall back on the next descriptor in the list whenever a descriptor fails to result in any moves.
If the rule would be that having some pseudo-legal moves which happen to be illegal should also allow fallback on the next descriptor, it would harder to implement in the AI. Because illegality of the move will only be discovered when a move has already been searched deep enough to also consider replies. And if a move of a piece that can have fallback would turn out illegal at that stage, it would have to figure out whether that was the only remaining move in the move list for that piece, and if so, turn back to generation to add the fall-back moves.
But of course there is less need to allow fallback in case the primary moves that exist are illegal; one could simply consider the piece pinned in that case. Like pieces that have no fallback would be; these often cannot move at all either. For globally mandatory moves that would be a bit unnatural, because it could potentially freeze all pieces if all mandatory moves would happen to be illegal, and thus lead to strange stalemates.
I suppose this would be easier to implement, at least at the level of pseudo-legal moves. A piece could have not a single, but a set of move descriptions (e.g. specified by a comma-separated list of XBetza notations). And the move generator would fall back on the next descriptor in the list whenever a descriptor fails to result in any moves.
If the rule would be that having some pseudo-legal moves which happen to be illegal should also allow fallback on the next descriptor, it would harder to implement in the AI. Because illegality of the move will only be discovered when a move has already been searched deep enough to also consider replies. And if a move of a piece that can have fallback would turn out illegal at that stage, it would have to figure out whether that was the only remaining move in the move list for that piece, and if so, turn back to generation to add the fall-back moves.
But of course there is less need to allow fallback in case the primary moves that exist are illegal; one could simply consider the piece pinned in that case. Like pieces that have no fallback would be; these often cannot move at all either. For globally mandatory moves that would be a bit unnatural, because it could potentially freeze all pieces if all mandatory moves would happen to be illegal, and thus lead to strange stalemates.