VASSAL Reference Manual

Home > Module > Game Piece Palette > Game Piece > Return to Deck


Return to Deck

The Return to Deck trait is used to move a piece into a Deck when the designated key command is received or the right-click context menu item is selected. If there is only one Deck in the module the piece will be added to it. If the module has more than one Deck, you may select the Deck that the piece will be placed in. Alternatively, you may prompt the players to choose a deck when the trait is activated.

EXAMPLE:
For a game in which cards are drawn from a deck, used, and placed into a discard pile, both the deck and the discard pile will be represented by a Deck component. By adding a Return to Deck trait to each card, with the text 'Discard' and the command Ctrl+R, then hitting Ctrl+R with a card selected will automatically send it to the discard pile.

Description:

A brief description of the purpose of this trait for your own reference.

Menu command:

Text for the right-click context menu option that will move the piece to the Deck. If left blank, no context menu item will appear but the trait can still be activated by the Key Command.

Key command:

The Keystroke or Named Command that initiates moving this piece to the Deck.

Choose destination deck at game time:

Check this option to let the player select a Deck to use at the time the trait is activated as opposed to predefining which Deck to return to beforehand.

Deck name:

Enter the name of the target Deck as a simple String or click the Select button to select from a list of the Decks available in this module.

Alternatively you can enter an Expression to calculate the name of the target Deck at the time the trait executes.

Prompt for destination deck:

Text to display when asking the player to select a Deck to return the piece to.

ReturnToDeck

ReturnToDeck2