Here’s my problem.

I have 36 decks A, which may or may not be empty, and 36 decks B that correspond to those decks on a one-for-one basis.

I have 66 pieces, which might end up in any one of those decks. The pieces have varying properties, but for the purposes of this problem let’s say 2 that matter, mutually exclusive dynamic properties X and Y.

I have 2 buttons. One sends any pieces in a deck A to a corresponding deck B. Simple. The other button sends only pieces with property X from a deck A to the corresponding deck B, and leaves pieces with property Y where they are.

How do I get the second kind of button working properly with a minimum amount of fuss?

Thanks,