| Switching must involves two different units.
| Switching while the king is under check is not allowed.
+figure.diagram-container
+ .diagram
+ | fen:1RB3k1/5ppp/8/8/8/8/8/K7:
+ figcaption White can mate in 1 by switching b8-c8
+
p.
Note: if the king and rook are on two adjacent squares, castling and switching
from the king are triggered in the same way. Castling takes priority: