Skip to content

Auxiliary.SelectUnselectGroup

Source Code | Auxiliary Functions

Checks if a subgroup that fulfills a function exists in a group, or lets a player select a subgroup that fulfills a function from a group.

Signature

Auxiliary.SelectUnselectGroup(Group g, Effect e, int tp, int minc, int maxc, SubgroupCheck|nil rescon, int chk) → bool

lua
Auxiliary.SelectUnselectGroup(g,e,tp,minc,maxc,rescon,chk)

Parameters

  • Group g

    The group to check.

  • Effect e

    The effect that will be passed to rescon.

  • int tp

    The player that will be passed to rescon.

  • int minc

    The minimum size of the subgroup that must exist in g.

  • int maxc

    The maximum number of the subgroup that must exist in g.

  • SubgroupCheck|nil rescon

    The function that must return true for a matching subgroup.

  • int chk

    Must be 0 when checking.

Returns

  • bool

    Returns true if a subgroup matches rescon.

Overload

Auxiliary.SelectUnselectGroup(Group g, Effect e, int tp, int minc, int maxc, SubgroupCheck|nil rescon, int chk, int seltp, int hintmsg, [SubgroupCheck|nil cancelcon, SubgroupCheck|nil breakcon, bool cancelable]) → Group

lua
Auxiliary.SelectUnselectGroup(g,e,tp,minc,maxc,rescon,chk)

When performing the selection, (i.e., chk is 1). Allows

Parameters

  • Group g

    The group to choose from.

  • Effect e

    The effect that will be passed to rescon, cancelcon, and breakcon.

  • int tp

    The player that will be passed to rescon, cancelcon, and breakcon.

  • int minc

    The minimum number of cards to be selected.

  • int maxc

    The maximum number of cards to be selected.

  • SubgroupCheck|nil rescon

    The function that must return true for a matching subgroup.

  • int chk

    Must be 1 to perform the selection.

  • int seltp

    The player performing the selection.

  • int hintmsg

    The HintMessage that will be displayed on selection.

  • SubgroupCheck|nil cancelcon

    Optional.

    A function that allows the player to cancel the selection if it returns true for the current selection.

  • SubgroupCheck|nil breakcon

    Optional.

    A function that forcibly stops the selection it returns true for the current selection.

  • bool cancelable

    Optional.

    If true, allows the player to cancel the selection even if the conditions are not fulfilled.

Returns