My cv has a similar exchanging pieces protocol. But it is possible to exchange only pieces of the same type: rook with rook, bishop with bishop, and so on. And, this is important, the exchange is automatic (without interaction with the players) at the end of the turn.
Can someone help me to implement this mechanism? How Hostage zillions file can be modified in this way?