Say I’m processing my way through a DeckVisitorDispatcher block of crud, and I reach a particular GamePiece, and I would like to check if that particular piece “is a member of any Deck” (as opposed to merely being in a Stack, or being not-in-a-stack-or-deck-at-all).
Anybody offhand know a good way to check “is this piece right here currently a member of any decks”?
Because apparently in KeyBufferer when band-selecting of things goes on, even though the little “VisitDeck” handler returns null, that prevents only “The Deck Itself” from being added to the selection, and does NOT prevent all the happy little MEMBERS of the deck from being selected.
If the player band-selects around ONLY the deck, this is harmless, because there’s then nothing “visibly selected” so way to accidentally drag the selected stuff anywhere.
But if the player band-selects around any regular unit/stack AND happens to include a deck in the band-select, THEN DISASTER AWAITS! Because it is now possible for the player to drag that regular unit/stack somewhere the entire contents of the deck will come with it.
I have identify where this processing occurs (in KeyBufferer), but now I need to figure out a way to exclude all the individual items that that are members of a deck, when it comes through the regular PieceVisitor.
Anyone know a zany trick? Would I just look to see if it had a parent, and if that parent “instanceof” Deck?
Brian